package com.fujica.abk.utils;

/**
 * HTTP响应封装类
 * @param <T> 响应数据类型
 */
public class R<T> {
    private boolean success;
    private String msg;
    private int code;
    private T data;

    public R() {
    }

    public R(String msg) {
        this.success = false;
        this.msg = msg;
        this.code = -1;
    }

    public R(boolean success, String msg, int code, T data) {
        this.success = success;
        this.msg = msg;
        this.code = code;
        this.data = data;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public String getMsg() {
        return msg;
    }

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

    public int getCode() {
        return code;
    }

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

    public T getData() {
        return data;
    }

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

}

