提交 | 用户 | 时间
|
ce910c
|
1 |
package com.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
/** |
|
4 |
* @author 251823 |
|
5 |
* @description 工装合规导入返回的错误码信息 |
|
6 |
* @date 2022/10/08 19:50:19 |
|
7 |
*/ |
|
8 |
public enum EM_WORKSUIT_APPEND_ERRCODE { |
|
9 |
/** |
|
10 |
* 未知 |
|
11 |
*/ |
|
12 |
EM_WORKSUIT_APPEND_ERRCODE_UNKNOWN(-1, "未知"), |
|
13 |
/** |
|
14 |
* 成功 |
|
15 |
*/ |
|
16 |
EM_WORKSUIT_APPEND_ERRCODE_SUCCESS(0, "成功"), |
|
17 |
/** |
|
18 |
* 组ID不存在或为空 |
|
19 |
*/ |
|
20 |
EM_WORKSUIT_APPEND_ERRCODE_INVALID_ID(1, "组ID不存在或为空"), |
|
21 |
/** |
|
22 |
* 数据库操作失败 |
|
23 |
*/ |
|
24 |
EM_WORKSUIT_APPEND_ERRCODE_DB_ERROR(2, "数据库操作失败"), |
|
25 |
/** |
|
26 |
* 图片大小不对 |
|
27 |
*/ |
|
28 |
EM_WORKSUIT_APPEND_ERRCODE_IMAGE_SIZE(3, "图片大小不对"), |
|
29 |
/** |
|
30 |
* 图片分辨率不对 |
|
31 |
*/ |
|
32 |
EM_WORKSUIT_APPEND_ERRCODE_IMAGE_RESO(4, "图片分辨率不对"), |
|
33 |
/** |
|
34 |
* 图片文件写入失败 |
|
35 |
*/ |
|
36 |
EM_WORKSUIT_APPEND_ERRCODE_IMAGE_WRITE(5, "图片文件写入失败"); |
|
37 |
|
|
38 |
private int value; |
|
39 |
|
|
40 |
private String note; |
|
41 |
|
|
42 |
public String getNote() { |
|
43 |
return note; |
|
44 |
} |
|
45 |
|
|
46 |
public int getValue() { |
|
47 |
return value; |
|
48 |
} |
|
49 |
|
|
50 |
EM_WORKSUIT_APPEND_ERRCODE(int givenValue, String note) { |
|
51 |
this.value = givenValue; |
|
52 |
this.note = note; |
|
53 |
} |
|
54 |
|
|
55 |
public static String getNoteByValue(int givenValue) { |
|
56 |
for (EM_WORKSUIT_APPEND_ERRCODE enumType : EM_WORKSUIT_APPEND_ERRCODE.values()) { |
|
57 |
if (givenValue == enumType.getValue()) { |
|
58 |
return enumType.getNote(); |
|
59 |
} |
|
60 |
} |
|
61 |
return null; |
|
62 |
} |
|
63 |
|
|
64 |
public static int getValueByNote(String givenNote) { |
|
65 |
for (EM_WORKSUIT_APPEND_ERRCODE enumType : EM_WORKSUIT_APPEND_ERRCODE.values()) { |
|
66 |
if (givenNote.equals(enumType.getNote())) { |
|
67 |
return enumType.getValue(); |
|
68 |
} |
|
69 |
} |
|
70 |
return -2; |
|
71 |
} |
|
72 |
|
|
73 |
public static EM_WORKSUIT_APPEND_ERRCODE getEnum(int value) { |
|
74 |
for (EM_WORKSUIT_APPEND_ERRCODE e : EM_WORKSUIT_APPEND_ERRCODE.values()) { |
|
75 |
if (e.getValue() == value) |
|
76 |
return e; |
|
77 |
} |
|
78 |
return EM_WORKSUIT_APPEND_ERRCODE.EM_WORKSUIT_APPEND_ERRCODE_UNKNOWN; |
|
79 |
} |
|
80 |
|
|
81 |
} |