InBoxResponse.java
1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
package com.yohoufo.inboxclient.model;
import org.apache.commons.lang3.StringUtils;
/**
* API 响应格式
* /**
* 响应为:
* <pre>
* {
* "code": 200,
* "message": "\u767b\u5f55\u6210\u529f",
* “alg": "SALT_MD5"
* "data": {
* "uid": "10216497",
* "passport": "18751986615",
* "session_key": "fa31d3a5d069c6c98cd8c38c3a5f89e6",
* "vip": 0
* },
* "md5": "fa5b07f95a0bf95c26ac50abf0024eed"
* }
* Created by chang@yoho.cn on 2015/11/3.
*/
public class InBoxResponse {
private static String DEFAULT_MSG = "操作成功";
private static int DEFAULT_CODE = 200;
private int code;
private String message;
private String md5;
//如果客户端判断有这个,则校验MD5
private String alg = "SALT_MD5";
private Object data;
public InBoxResponse() {
this(DEFAULT_CODE, DEFAULT_MSG, null);
}
public InBoxResponse(int code, String message, Object data) {
this.code = code;
if (StringUtils.isNotEmpty(message)) {
this.message = message;
}
this.data = data;
}
public String getAlg() {
return alg;
}
public void setAlg(String alg) {
this.alg = alg;
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getMd5() {
return md5;
}
public void setMd5(String md5) {
this.md5 = md5;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
}