-
Notifications
You must be signed in to change notification settings - Fork 257
Expand file tree
/
Copy pathResult.java
More file actions
65 lines (51 loc) · 1.14 KB
/
Result.java
File metadata and controls
65 lines (51 loc) · 1.14 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
package cn.aofeng.demo.proxy;
/**
* 账号服务操作结果。
*
* @author <a href="mailto:aofengblog@163.com">聂勇</a>
*/
public class Result {
/**
* 200xxxx 表示成功。<br/>
* 400xxxx 表示参数错误。<br/>
* 500xxxx 表示服务内部错误。
*/
private int code;
/**
* code对应的描述信息。
*/
private String msg;
/**
* 只有code为200xxxx时才有值,其他情况下为null。
*/
private User data;
public Result() {
// nothing
}
public Result(int code, String msg) {
this.code = code;
this.msg = msg;
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public User getData() {
return data;
}
public void setData(User data) {
this.data = data;
}
@Override
public String toString() {
return "Result [code=" + code + ", msg=" + msg + ", data=" + data + "]";
}
}