package cn.stylefeng.roses.kernel.rule.enums;
|
|
import lombok.Getter;
|
|
/**
|
* 系统设置-枚举
|
*
|
* @author goupan
|
*/
|
@Getter
|
public enum SystemSetEnum {
|
|
USER_AGREEMENT(1, "用户协议h5"),
|
PRIVACY_AGREEMENT(2, "隐私协议h5"),
|
SERVICE_AGREEMENT(3, "服务协议h5"),
|
ENTERPRISE_SERVICE(4, "企业服务h5"),
|
OFFLINE_STORE(5, "线下门店h5"),
|
COOPERATIVE_ENTERPRISE(6, "合作企业h5"),
|
CUSTOMER_SERVICE_NUMBER(7, "客服电话(逗号拼接)"),
|
COUNSELLING_CONTRACT(8, "咨询合同h5"),
|
UNSUBSCRIBE_AGREEMENT(9, "注销协议"),
|
SYSTEM_NOTICE(10, "系统公告"),
|
|
START_PAGE(100, "启动页"),
|
;
|
|
private final Integer code;
|
|
private final String name;
|
|
SystemSetEnum(int code, String name) {
|
this.code = code;
|
this.name = name;
|
}
|
|
/**
|
* 根据code获取枚举
|
*/
|
public static SystemSetEnum codeToEnum(Integer code) {
|
if (null != code) {
|
for (SystemSetEnum e : SystemSetEnum.values()) {
|
if (e.getCode().equals(code)) {
|
return e;
|
}
|
}
|
}
|
return null;
|
}
|
|
/**
|
* 编码转化成中文含义
|
*/
|
public static String codeToName(Integer code) {
|
if (null != code) {
|
for (SystemSetEnum e : SystemSetEnum.values()) {
|
if (e.getCode().equals(code)) {
|
return e.getName();
|
}
|
}
|
}
|
return "未知";
|
}
|
|
@Override
|
public String toString() {
|
return "系统设置(" + code + ", " + name + ")";
|
}
|
|
}
|