package com.prolog.eis.message;

public class WcsRestMessage<T> {
    private boolean ret;
    private String msg;
    private T data;
    private String serviceName;

    public String getServiceName() {
        return this.serviceName;
    }

    public void setServiceName(String serviceName) {
        this.serviceName = serviceName;
    }

    public WcsRestMessage() {
    }

    public static <T> WcsRestMessage<T> queryRet(T data) {
        return new WcsRestMessage(true, "查询成功", data);
    }

    public static <T> WcsRestMessage<T> doRet(T data) {
        return new WcsRestMessage(true, "操作成功", data);
    }

    public static <T> WcsRestMessage<T> ret(String msg, T data) {
        return new WcsRestMessage(true, msg, data);
    }

    public static <T> WcsRestMessage<T> error(String msg) {
        return new WcsRestMessage(false, msg, (Object)null);
    }

    public static <T> WcsRestMessage<T> queryError(String msg) {
        return new WcsRestMessage(false, String.format("查询失败，原因：%s", msg), (Object)null);
    }

    public static <T> WcsRestMessage<T> doError(String msg) {
        return new WcsRestMessage(false, String.format("操作失败，原因：%s", msg), (Object)null);
    }

    public static <T> WcsRestMessage<T> error(String code, String msg) {
        return new WcsRestMessage(false, msg, (Object)null);
    }

    public static <T> WcsRestMessage<T> newInstance(boolean ret, String msg) {
        return new WcsRestMessage(ret, msg, (Object)null);
    }

    public static <T> WcsRestMessage<T> newInstance(boolean ret, String msg, T data) {
        return new WcsRestMessage(ret, msg, data);
    }

    public WcsRestMessage(boolean ret, String msg, T data) {
        this.ret = ret;
        this.msg = msg;
        this.data = data;
    }

    public boolean isRet() {
        return ret;
    }

    public void setRet(boolean ret) {
        this.ret = ret;
    }

    public String getMsg() {
        return msg;
    }

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

    public T getData() {
        return data;
    }

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