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
package cn.wisenergy.common.utils.exception;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author wyy
* @date 2019-10-11 20:51
*/
@Data
@ApiModel("返回结果")
public class Result<T> {
// 结果标识
@ApiModelProperty(value = "结果标识",example = "success")
private String result;
// 错误编码
@ApiModelProperty(value = "错误编码",example = "1001")
private String errorCode;
// 错误信息
@ApiModelProperty(value = "错误信息",example = "操作成功")
public String errorMsg;
// 封装数据的参数名称
@ApiModelProperty(value = "返回结果")
private T data;
/**
* 结果参数枚举
*/
public enum RESULT_FLG {
SUCCESS("success"),
FAIL("fail");
/**
* 值变量
*/
private String value;
/**
* 含有结果值的构造函数
*
* @param value
*/
private RESULT_FLG(String value) {
this.value = value;
}
/**
* 获取值
*
* @return
*/
public String getValue() {
return this.value;
}
}
}