提交 | 用户 | 时间
|
e7c126
|
1 |
package com.iailab.framework.common.enums; |
H |
2 |
|
|
3 |
import com.iailab.framework.common.core.IntArrayValuable; |
|
4 |
import lombok.Getter; |
|
5 |
import lombok.RequiredArgsConstructor; |
|
6 |
|
|
7 |
import java.util.Arrays; |
|
8 |
|
|
9 |
/** |
|
10 |
* 终端的枚举 |
|
11 |
* |
|
12 |
* @author iailab |
|
13 |
*/ |
|
14 |
@RequiredArgsConstructor |
|
15 |
@Getter |
|
16 |
public enum TerminalEnum implements IntArrayValuable { |
|
17 |
|
|
18 |
UNKNOWN(0, "未知"), // 目的:在无法解析到 terminal 时,使用它 |
|
19 |
WECHAT_MINI_PROGRAM(10, "微信小程序"), |
|
20 |
WECHAT_WAP(11, "微信公众号"), |
|
21 |
H5(20, "H5 网页"), |
|
22 |
APP(31, "手机 App"), |
|
23 |
; |
|
24 |
|
|
25 |
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(TerminalEnum::getTerminal).toArray(); |
|
26 |
|
|
27 |
/** |
|
28 |
* 终端 |
|
29 |
*/ |
|
30 |
private final Integer terminal; |
|
31 |
/** |
|
32 |
* 终端名 |
|
33 |
*/ |
|
34 |
private final String name; |
|
35 |
|
|
36 |
@Override |
|
37 |
public int[] array() { |
|
38 |
return ARRAYS; |
|
39 |
} |
|
40 |
} |