package com.mvc.model;

/**
 * 请求结果对象,对应前台Gekker框架部分
 */
public class ResultGeekerModel {
    public ResultGeekerModel() {

    }

    /**
     * 请求正常的结果
     *
     * @param data
     */
    public ResultGeekerModel(Object data) {
        this.data = data;
        this.code = 200;
        this.msg = "成功";
    }

    //应对返回值是字符串的场景
    public ResultGeekerModel(String data,boolean isSuccess) {
        this.data = data;
        this.code = 200;
        this.msg = "成功";
    }

    /**
     * 请求异常的结果
     *
     * @param error
     */
    public ResultGeekerModel(String error) {
        code = 500;
        msg = error;
    }

    private Integer code;
    private String msg;
    private Object data;

    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 Object getData() {
        return data;
    }

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