package com.ximai.mes.remote.dto;

import com.fasterxml.jackson.annotation.JsonProperty;

public class ErpResponseResult<TReturn>{

    /*
    interface ErrorInfoStructure {
  success: boolean; // if request is success
  data?: any; // response data
  errorCode?: string; // code for errorType
  errorMessage?: string; // message display to user
  showType?: number; // error display type： 0 silent; 1 message.warn; 2 message.error; 4 notification; 9 page
  traceId?: string; // Convenient for back-end Troubleshooting: unique request ID
  host?: string; // Convenient for backend Troubleshooting: host of current access server
}
     */
    @JsonProperty("success")
    private boolean success;
    @JsonProperty("data")
    private TReturn data;
    @JsonProperty("errorCode")
    private String errorCode = "";
    @JsonProperty("errorMessage")
    private String errorMessage = "";
    @JsonProperty("showType")
    private Integer showType = 0;
    @JsonProperty("traceId")
    private String traceId = "";
    @JsonProperty("host")
    private String host = "";

    public boolean isSuccess() {
        return success;
    }

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

    public TReturn getData() {
        return data;
    }

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

    public String getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(String errorCode) {
        this.errorCode = errorCode;
    }

    public String getErrorMessage() {
        return errorMessage;
    }

    public void setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
    }

    public Integer getShowType() {
        return showType;
    }

    public void setShowType(Integer showType) {
        this.showType = showType;
    }

    public String getTraceId() {
        return traceId;
    }

    public void setTraceId(String traceId) {
        this.traceId = traceId;
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }
}
