package common;

import com.alibaba.fastjson.JSONObject;
import util.Tools;

public class Resp {
    int retCode;
    String retMsg;
    JSONObject data;


    public Resp() {
    }

    public <T> T getData(Class<T> clazz) {
        return Tools.toJavaClass(this.data, clazz);
    }

    public JSONObject getData() {
        return data;
    }

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

    public Resp(int retCode, String retMsg, JSONObject data) {
        this.retCode = retCode;
        this.retMsg = retMsg;
        this.data = data;
    }

    public int getRetCode() {
        return retCode;
    }

    public void setRetCode(int retCode) {
        this.retCode = retCode;
    }

    public String getRetMsg() {
        return retMsg;
    }

    public void setRetMsg(String retMsg) {
        this.retMsg = retMsg;
    }
}
