package cn.com.countrygarden.bi.main.core;

import com.alibaba.fastjson.JSON;

/**
 * 统一API响应结果封装
 */
public class Result {


    private int resultCode;
    private String resultMsg;
    private Object data;
    private int code = 0;
    private String message = "";


    public int getResultCode() {
        return resultCode;
    }

    public Result setResultCode(ResultCode resultCode) {
        this.resultCode = resultCode.code;
        return this;
    }

    public Result setResultCode(int resultCode) {
        this.resultCode = resultCode;
        return this;
    }

    public String getResultMsg() {
        return resultMsg;
    }

    public Result setResultMsg(String resultMsg) {
        this.resultMsg = resultMsg;
        return this;
    }

    public Object getData() {
        return data;
    }

    public Result setData(Object data) {
        this.data = data;
        return this;
    }

    public int getCode() {
        return code;
    }

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

    public String getMessage() {
        return message;
    }

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

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