AccountTypeEnum.java
1.06 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
package cn.fw.freya.enums;
import lombok.Getter;
/**
* @author null
* @date 2021-11-12 09:44
* @description Cookie类型
*/
public enum AccountTypeEnum {
KS(1, "快手"),// 快手
DY(2, "抖音"),// 抖音
DCD(3, "懂车帝"),// 懂车帝
BILIBILI(4, "哔哩哔哩"),// 哔哩哔哩
;
@Getter
private final Integer value;
@Getter
private final String name;
AccountTypeEnum(final Integer value, final String name) {
this.value = value;
this.name = name;
}
public static AccountTypeEnum getEnumByValue(final Integer value) {
for (final AccountTypeEnum typeEnum : AccountTypeEnum.values()) {
if (typeEnum.value.equals(value)) {
return typeEnum;
}
}
return null;
}
public static String getNameByValue(final Integer value) {
for (final AccountTypeEnum typeEnum : AccountTypeEnum.values()) {
if (typeEnum.value.equals(value)) {
return typeEnum.getName();
}
}
return "";
}
}