TrackExceptionEnum.java
1.03 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
package com.sl.ms.track.enums;
import cn.hutool.core.util.EnumUtil;
import com.sl.transport.common.enums.BaseExceptionEnum;
/**
* 异常枚举
*
* @author zzj
* @version 1.0
*/
public enum TrackExceptionEnum implements BaseExceptionEnum {
TRACK_ALREADY_EXISTS(1001, "轨迹已经存在");
private Integer code;
private Integer status;
private String value;
TrackExceptionEnum(Integer code, String value) {
this.code = code;
this.value = value;
this.status = 500;
}
TrackExceptionEnum(Integer code, Integer status, String value) {
this.code = code;
this.value = value;
this.status = status;
}
@Override
public Integer getCode() {
return this.code;
}
@Override
public String getValue() {
return this.value;
}
@Override
public Integer getStatus() {
return this.status;
}
public static TrackExceptionEnum codeOf(Integer code) {
return EnumUtil.getBy(TrackExceptionEnum::getCode, code);
}
}