| File was renamed from oying-system/src/main/java/com/oying/modules/message/common/OrderStatusEnum.java |
| | |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum OrderStatusEnum { |
| | | public enum MsgStatusEnum { |
| | | //订单消息 通知状态 用于插入 |
| | | //订单状态需要满足: |
| | | /// 商户: 订单类消息,包括买家下单提醒、订单送达通知等 |
| | |
| | | /** |
| | | * 反向映射,提升查找速度 |
| | | */ |
| | | private static final Map<Integer, OrderStatusEnum> MAP = |
| | | private static final Map<Integer, MsgStatusEnum> MAP = |
| | | Arrays.stream(values()) |
| | | .collect(Collectors.toMap(OrderStatusEnum::getKey, Function.identity())); |
| | | .collect(Collectors.toMap(MsgStatusEnum::getKey, Function.identity())); |
| | | private final Integer key; |
| | | private final String value; |
| | | |
| | |
| | | /** |
| | | * 根据 key 获取枚举 |
| | | */ |
| | | public static OrderStatusEnum of(Integer key) { |
| | | public static MsgStatusEnum of(Integer key) { |
| | | return key == null ? null : MAP.get(key); |
| | | } |
| | | |
| | |
| | | * 根据 key 获取描述 |
| | | */ |
| | | public static String descOf(Integer key) { |
| | | OrderStatusEnum e = of(key); |
| | | MsgStatusEnum e = of(key); |
| | | return e == null ? "" : e.getValue(); |
| | | } |
| | | } |