forked from nibnait/algorithms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBaseResponse.java
More file actions
52 lines (37 loc) · 1.05 KB
/
BaseResponse.java
File metadata and controls
52 lines (37 loc) · 1.05 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
package common.bo;
import common.enums.ErrorCode;
import java.io.Serializable;
public class BaseResponse<T> implements Serializable {
private static final long serialVersionUID = 1L;
public Long code;
public String message;
public T data;
public Integer errtag = 0;
public BaseResponse() {
}
public BaseResponse(Long code, String message, T data) {
super();
this.code = code;
this.message = message;
this.data = data;
}
public BaseResponse(Long code, Integer errtag, String message, T data) {
super();
this.code = code;
this.errtag = errtag;
this.message = message;
this.data = data;
}
public BaseResponse(T data) {
super();
this.code = ErrorCode.SUCCESS.getCode();
this.message = ErrorCode.SUCCESS.getMessage();
this.data = data;
}
public BaseResponse(ErrorCode e, T data) {
super();
this.code = e.getCode();
this.message = e.getMessage();
this.data = data;
}
}