ResponseVo.java
1.77 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
package com.viontech.match.entity.vo;
import com.viontech.keliu.model.Person;
import com.viontech.keliu.model.Pool;
import com.viontech.match.entity.PoolInfo;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.util.List;
/**
* .
*
* @author 谢明辉
* @date 2020/11/27
*/
@Getter
@Setter
@ToString
public class ResponseVo {
private Integer success;
private String description;
private String rid;
private Integer errCode;
private List<Pool> personPoolStatus;
private Integer oper;
private Integer index;
private Integer match;
private List<PoolInfo> poolIds;
private List<Person> matchPersons;
private List<Person> matchBodies;
public ResponseVo(String rid) {
this.rid = rid;
}
public static ResponseVo commandNotFound(String rid) {
return error(rid, "command not found");
}
public static ResponseVo error(String rid, String description) {
return error(rid, 1, description);
}
public static ResponseVo error(String rid, Integer errCode, String description) {
ResponseVo responseVo = new ResponseVo(rid);
responseVo.setSuccess(0);
responseVo.setErrCode(errCode);
responseVo.setDescription(description);
return responseVo;
}
public static ResponseVo success(String rid) {
return success(rid, "success");
}
public static ResponseVo success(String rid, String description) {
ResponseVo responseVo = new ResponseVo(rid);
responseVo.setSuccess(1);
responseVo.setDescription(description);
responseVo.setErrCode(0);
return responseVo;
}
public static ResponseVo poolIdNotExists(String rid) {
return ResponseVo.error(rid, 4, "poolId not exists");
}
}