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;
|
}
|
|
}
|