package com.diagbot.dto;

import java.io.Serializable;

/**
 * @Description: 通用返回格式
 * @author: gaodm
 * @time: 2018/8/1 14:55
 */
public class RespDTO<T> implements Serializable{

    public static final String TRUE_CODE = "0";
    public String code = TRUE_CODE;
    public String msg = "";
    public T data;

    public static RespDTO onSuc(Object data) {
        RespDTO resp = new RespDTO();
        resp.data = data;
        return resp;
    }

    @Override
    public String toString() {
        return "RespDTO{" +
                "code=" + code +
                ", error='" + msg + '\'' +
                ", data=" + data +
                '}';
    }
}
