统一接受返回报文定义 已经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 + "]"; } }
相关文章推荐
- C#编程:枚举(enum)与结构(struct)的定义和使用方法
- 使用Tinyxml.lib链接出错问题解决 (LIBCMT.lib(sprintf.obj) : error LNK2005: _sprintf_s 已经在 msvcrtd.lib(MSVCR80D.dll) 中定义)
- Hibernate查询,返回new对象(注意这个新定义的类要有构造函数),使用sql带条件分页查询并且把结果显示到一个对象的集里面的解决方案
- 解析xml文件中定义的请求报文和返回报文字段
- Java enum类的定义即使用
- 使用Rational Method Composer 定义客户化的统一过程
- java使用POST发送soap报文请求webservice返回500错误解析
- C/C++:enum-枚举量声明、定义和使用
- C/C++:[2]enum-枚举量声明、定义和使用
- RxJava Retrofit2 网络请求,返回数据格式统一的数据报文处理方法
- 使用Tinyxml.lib链接出错问题解决 (LIBCMT.lib(sprintf.obj) : error LNK2005: _sprintf_s 已经在 msvcrtd.lib(MSVCR80D.dll) 中定义)
- 使用形式语言定义通信报文格式
- 通过jquery获取元素宽高时,此元素必须明确定义了宽高或已经被追加到页面中,否则返回的宽高都是0
- Hibernate查询,返回new对象(注意这个新定义的类要有构造函数),使用sql带条件分页查询并且把结果显示到一个对象的集里面的解决方案
- ajax中接受返回字符串转为json并进行处理(不使用jquery)
- 使用企业库调用存储过程,并接受return 的返回值
- C#枚举enum定义使用
- iOS enum 定义与使用
- RxJava Retrofit2 网络请求,返回数据格式统一的数据报文处理方法
- 在Java中使用HttpURLConnection发送http客户端请求、服务器端返回信息、接受服务器端的信息