package ink.wgink.gateway.pojo.result;

import java.io.Serializable;

/**
 * @ClassName: ErrorResult
 * @Description: 错误结果
 * @Author: WangGeng
 * @Date: 2019/3/2 3:37 PM
 * @Version: 1.0
 **/
public class ErrorResult implements Serializable {

    private Integer code;
    private String msg;
    private String detail;

    public ErrorResult() {
    }

    public ErrorResult(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

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

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public String getDetail() {
        return detail == null ? "" : detail.trim();
    }

    public void setDetail(String detail) {
        this.detail = detail;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("{");
        sb.append("\"code\":")
                .append(code);
        sb.append(",\"msg\":\"")
                .append(msg).append('\"');
        sb.append(",\"detail\":\"")
                .append(detail).append('\"');
        sb.append('}');
        return sb.toString();
    }
}
