您的位置:首页 > 其它

统一接受返回报文定义 已经enum的使用

2017-06-24 16:23 295 查看
统一返回DTO:

public class CommonResponseData<T extends Serializable> implements Serializable {

private static final String ZERO = "0";

/**
*
*/
private static final long serialVersionUID = 3278611319011091487L;

/**
* 默认成功
*/
private boolean success = true;
private String responseCode = ZERO;
/**
* 错误信息(自己查看)
*/
private String responseMsg;
/**
* 错误信息(展示给客户)
*/
private String responseShowMsg;
/**
* 返回值
*/
private T data;

public boolean isSuccess() {
return success;
}

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

public String getResponseCode() {
return responseCode;
}

public void setResponseCode(String responseCode) {
this.responseCode = responseCode;
}

public String getResponseMsg() {
return responseMsg;
}

public void setResponseMsg(String responseMsg) {
this.responseMsg = responseMsg;
}

public T getData() {
return data;
}

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

public String getResponseShowMsg() {
return responseShowMsg;
}

public void setResponseShowMsg(String responseShowMsg) {
this.responseShowMsg = responseShowMsg;
}

@Override
public String toString() {
return "CommonResponseData [success=" + success + ", responseCode=" + responseCode + ", responseMsg="
+ responseMsg + ", responseShowMsg=" + responseShowMsg + ", data=" + data + "]";
}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐