package cn.edu.whu.boot.common.domain;

import com.alibaba.fastjson.JSON;

import java.io.Serializable;

/**
 * 异常信息
 * @author CXJ
 */
public class ExceptionInfo<T> implements Serializable {

    private static final Long serialVersionUID = 1007L;
    public static final Integer OK = 200;
    public static final Integer ERROR = 500;

    private Integer code;
    private String message;
    private String url;
    private T data;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }
}
