#
Junjie
2024-01-11 901b2ab3e0e7c592602848cfa256f34c5b0c7bb8
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
package com.zy.asrs.common.domain.enums;
 
public enum ApiType {
 
    ORDER_COMPLETE("order_complete", "订单完成"),
    ORDER_CANCEL("order_cancel", "订单取消"),
    REPORT_STOCK("report_stock", "库存上报"),
    ;
    public String type;
    public String desc;
 
    ApiType(String type, String desc) {
        this.type = type;
        this.desc = desc;
    }
 
    public static ApiType get(String id) {
        if (null == id) {
            return null;
        }
        for (ApiType type : ApiType.values()) {
            if (type.type.equals(id)) {
                return type;
            }
        }
        return null;
    }
 
    public static ApiType get(ApiType type) {
        if (null == type) {
            return null;
        }
        for (ApiType type1 : ApiType.values()) {
            if (type1 == type) {
                return type1;
            }
        }
        return null;
    }
 
}