| | |
| | | package com.iailab.framework.common.enums; |
| | | |
| | | import com.iailab.framework.common.core.IntArrayValuable; |
| | | import com.iailab.framework.common.core.ArrayValuable; |
| | | import lombok.Getter; |
| | | import lombok.RequiredArgsConstructor; |
| | | |
| | |
| | | */ |
| | | @RequiredArgsConstructor |
| | | @Getter |
| | | public enum TerminalEnum implements IntArrayValuable { |
| | | public enum TerminalEnum implements ArrayValuable { |
| | | |
| | | UNKNOWN(0, "未知"), // 目的:在无法解析到 terminal 时,使用它 |
| | | WECHAT_MINI_PROGRAM(10, "微信小程序"), |
| | |
| | | APP(31, "手机 App"), |
| | | ; |
| | | |
| | | public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(TerminalEnum::getTerminal).toArray(); |
| | | public static final Integer[] ARRAYS = Arrays.stream(values()).map(TerminalEnum::getTerminal).toArray(Integer[]::new); |
| | | |
| | | /** |
| | | * 终端 |
| | |
| | | private final String name; |
| | | |
| | | @Override |
| | | public int[] array() { |
| | | public Integer[] array() { |
| | | return ARRAYS; |
| | | } |
| | | } |