提交 | 用户 | 时间
|
149dd0
|
1 |
package com.iailab.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
/** |
|
4 |
* @author 47081 |
|
5 |
* @version 1.0 |
|
6 |
* @description 建模失败原因 |
|
7 |
* @date 2021/4/22 |
|
8 |
*/ |
|
9 |
public enum EM_PERSON_FEATURE_ERRCODE { |
|
10 |
/** 未知 */ |
|
11 |
EM_PERSON_FEATURE_ERRCODE_UNKNOWN(0, "未知"), |
|
12 |
/** 图片格式问题 */ |
|
13 |
EM_PERSON_FEATURE_ERRCODE_PIC_FORMAT(1, "图片格式问题"), |
|
14 |
/** 无人脸或不清晰 */ |
|
15 |
EM_PERSON_FEATURE_ERRCODE_NO_FACE(2, "无人脸或不清晰"), |
|
16 |
/** 多个人脸 */ |
|
17 |
EM_PERSON_FEATURE_ERRCODE_MULTI_FACE(3, "多个人脸"), |
|
18 |
/** 图片解码失败 */ |
|
19 |
EM_PERSON_FEATURE_ERRCODE_PIC_DECODE_FAIL(4, "图片解码失败"), |
|
20 |
/** 不推荐入库 */ |
|
21 |
EM_PERSON_FEATURE_ERRCODE_NOT_RECOMMEND(5, "不推荐入库"), |
|
22 |
/** 数据库操作失败 */ |
|
23 |
EM_PERSON_FEATURE_ERRCODE_FACEDB_FAIL(6, "数据库操作失败"), |
|
24 |
/** 获取图片失败 */ |
|
25 |
EM_PERSON_FEATURE_ERRCODE_GET_PICTURE(7, "获取图片失败"), |
|
26 |
/** 系统异常 */ |
|
27 |
EM_PERSON_FEATURE_ERRCODE_SYSTEM_ERROR(8, "系统异常"); |
|
28 |
private int errorCode; |
|
29 |
private String reason; |
|
30 |
|
|
31 |
EM_PERSON_FEATURE_ERRCODE(int errorCode, String reason) { |
|
32 |
this.errorCode = errorCode; |
|
33 |
this.reason = reason; |
|
34 |
} |
|
35 |
|
|
36 |
public int getErrorCode() { |
|
37 |
return errorCode; |
|
38 |
} |
|
39 |
|
|
40 |
public void setErrorCode(int errorCode) { |
|
41 |
this.errorCode = errorCode; |
|
42 |
} |
|
43 |
|
|
44 |
public String getReason() { |
|
45 |
return reason; |
|
46 |
} |
|
47 |
|
|
48 |
public void setReason(String reason) { |
|
49 |
this.reason = reason; |
|
50 |
} |
|
51 |
|
|
52 |
public static EM_PERSON_FEATURE_ERRCODE getError(int errorCode) { |
|
53 |
for (EM_PERSON_FEATURE_ERRCODE personError : EM_PERSON_FEATURE_ERRCODE.values()) { |
|
54 |
if (personError.errorCode == errorCode) { |
|
55 |
return personError; |
|
56 |
} |
|
57 |
} |
|
58 |
return EM_PERSON_FEATURE_ERRCODE_UNKNOWN; |
|
59 |
} |
|
60 |
|
|
61 |
public static String getErrorMessage(int errorCode) { |
|
62 |
return getError(errorCode).getReason(); |
|
63 |
} |
|
64 |
} |