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
| package com.iailab.framework.common.enums;
|
| import com.iailab.framework.common.core.IntArrayValuable;
| import lombok.Getter;
| import lombok.RequiredArgsConstructor;
|
| import java.util.Arrays;
|
| /**
| * 终端的枚举
| *
| * @author iailab
| */
| @RequiredArgsConstructor
| @Getter
| public enum TerminalEnum implements IntArrayValuable {
|
| UNKNOWN(0, "未知"), // 目的:在无法解析到 terminal 时,使用它
| WECHAT_MINI_PROGRAM(10, "微信小程序"),
| WECHAT_WAP(11, "微信公众号"),
| H5(20, "H5 网页"),
| APP(31, "手机 App"),
| ;
|
| public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(TerminalEnum::getTerminal).toArray();
|
| /**
| * 终端
| */
| private final Integer terminal;
| /**
| * 终端名
| */
| private final String name;
|
| @Override
| public int[] array() {
| return ARRAYS;
| }
| }
|
|