提交 | 用户 | 时间
|
ce910c
|
1 |
package com.netsdk.lib.enumeration; |
H |
2 |
|
|
3 |
/** |
|
4 |
* @author 47081 |
|
5 |
* @version 1.0 |
|
6 |
* @description 音频文件预上传错误原因 |
|
7 |
* @date 2020/6/10 |
|
8 |
*/ |
|
9 |
public enum EM_REASON_TYPE { |
|
10 |
/** |
|
11 |
* 未知原因 |
|
12 |
*/ |
|
13 |
EM_REASON_TYPE_UNKNOWN(0, "未知原因"), |
|
14 |
/** |
|
15 |
* 文件个数超出 |
|
16 |
*/ |
|
17 |
EM_REASON_TYPE_OVERNUMBER(1, "文件个数超出"), |
|
18 |
/** |
|
19 |
* 文件存储已满 |
|
20 |
*/ |
|
21 |
EM_REASON_TYPE_FULLSTORAGE(2, "文件存储空间已满"), |
|
22 |
/** |
|
23 |
* 文件太大 |
|
24 |
*/ |
|
25 |
EM_REASON_TYPE_TOOLARGE_FILE(3, "该文件太大"), |
|
26 |
/** |
|
27 |
* 无效的文件类型 |
|
28 |
*/ |
|
29 |
EM_REASON_TYPE_INVALID_FILETYPE(4, "无效的文件类型"), |
|
30 |
/** |
|
31 |
* 没有上传权限 |
|
32 |
*/ |
|
33 |
EM_REASON_TYPE_UNAUTH_UPLOAD(5, "没有上传权限"), |
|
34 |
/** |
|
35 |
* 文件命名异常 |
|
36 |
*/ |
|
37 |
EM_REASON_TYPE_EXCEPTION_NAME(6, "文件命名异常"), |
|
38 |
/** |
|
39 |
* 文件名太长 |
|
40 |
*/ |
|
41 |
EM_REASON_TYPE_TOOLONG_NAME(7, "文件名太长"), |
|
42 |
/** |
|
43 |
* 文件名已存在 |
|
44 |
*/ |
|
45 |
EM_REASON_TYPE_EXIST_NAME(8, "文件名已存在"); |
|
46 |
private int type; |
|
47 |
private String reason; |
|
48 |
|
|
49 |
private EM_REASON_TYPE(int type, String reson) { |
|
50 |
this.type = type; |
|
51 |
this.reason = reson; |
|
52 |
} |
|
53 |
|
|
54 |
public String getReason() { |
|
55 |
return reason; |
|
56 |
} |
|
57 |
|
|
58 |
public int getType() { |
|
59 |
return type; |
|
60 |
} |
|
61 |
|
|
62 |
public static String getReason(int type) { |
|
63 |
for (EM_REASON_TYPE reason : EM_REASON_TYPE.values()) { |
|
64 |
if (type == reason.getType()) { |
|
65 |
return reason.getReason(); |
|
66 |
} |
|
67 |
} |
|
68 |
return null; |
|
69 |
} |
|
70 |
|
|
71 |
public static EM_REASON_TYPE getReasonType(int type) { |
|
72 |
for (EM_REASON_TYPE reason : EM_REASON_TYPE.values()) { |
|
73 |
if (type == reason.type) { |
|
74 |
return reason; |
|
75 |
} |
|
76 |
} |
|
77 |
return null; |
|
78 |
} |
|
79 |
} |