package com.stylefeng.guns.modular.system.enums;
|
|
|
|
/**
|
* @Description 系统规则配置
|
* @Author xiaochen
|
* @Date 2023/02/15 9:42
|
*/
|
public enum SystemConfigTypeEnum {
|
|
/*类型(1=派单规则,2=佣金分成规则,3=抽成规则,4=积分规则,5=价格规则,6=余额规则,7=客服管理)*/
|
|
DISPATCH_RULES(1, "派单规则"),
|
COMMISSION_SHARING_RULES(2, "佣金分成规则"),
|
EXTRACTION_RULE(3, "抽成规则"),
|
INTEGRAL_RULE(4, "积分规则"),
|
PRICE_RULES(5, "价格规则"),
|
BALANCE_RULES(6, "余额规则"),
|
CUSTOMER_SERVICE_MGMT(7,"客服管理");
|
|
private String desc;
|
|
|
private int code;
|
|
|
SystemConfigTypeEnum(int code, String desc) {
|
this.code = code;
|
this.desc = desc;
|
}
|
|
public String getDesc() {
|
return desc;
|
}
|
|
public int getCode() {
|
return code;
|
}
|
|
/**
|
* 通过code获取枚举
|
*
|
* @param code
|
* @return
|
*/
|
public static SystemConfigTypeEnum fromCode(Integer code) {
|
SystemConfigTypeEnum[] resultTypes = SystemConfigTypeEnum.values();
|
for (SystemConfigTypeEnum resultType : resultTypes) {
|
if (code.equals(resultType.getCode())) {
|
return resultType;
|
}
|
}
|
return null;
|
}
|
|
}
|