opt: 枚举类中的属性值都使用final修饰

master
reminis 3 years ago
parent c3d4ac43e0
commit 4473acfb9e

@ -29,8 +29,8 @@ public enum AnchorState {
; ;
private Integer code; private final Integer code;
private String description; private final String description;
/** /**
* code * code

@ -21,8 +21,8 @@ public enum AuditStatus {
AUDIT_SUCCESS(20, "审核成功"), AUDIT_SUCCESS(20, "审核成功"),
AUDIT_REJECT(30, "被拒绝"); AUDIT_REJECT(30, "被拒绝");
private Integer code; private final Integer code;
private String description; private final String description;
} }

@ -34,29 +34,29 @@ public enum ChannelType {
/** /**
* *
*/ */
private Integer code; private final Integer code;
/** /**
* *
*/ */
private String description; private final String description;
/** /**
* Class * Class
*/ */
private Class contentModelClass; private final Class<? extends ContentModel> contentModelClass;
/** /**
* *
*/ */
private String codeEn; private final String codeEn;
/** /**
* codeclass * codeclass
* @param code * @param code
* @return * @return
*/ */
public static Class getChanelModelClassByCode(Integer code) { public static Class<? extends ContentModel> getChanelModelClassByCode(Integer code) {
ChannelType[] values = values(); ChannelType[] values = values();
for (ChannelType value : values) { for (ChannelType value : values) {
if (value.getCode().equals(code)) { if (value.getCode().equals(code)) {

@ -19,8 +19,8 @@ public enum DeduplicationType {
CONTENT(10, "N分钟相同内容去重"), CONTENT(10, "N分钟相同内容去重"),
FREQUENCY(20, "一天内N次相同渠道去重"), FREQUENCY(20, "一天内N次相同渠道去重"),
; ;
private Integer code; private final Integer code;
private String description; private final String description;
/** /**

@ -19,8 +19,8 @@ public enum FileType {
COMMON_FILE("30", "file"), COMMON_FILE("30", "file"),
VIDEO("40", "video"), VIDEO("40", "video"),
; ;
private String code; private final String code;
private String name; private final String name;
public static String getNameByCode(String code) { public static String getNameByCode(String code) {
for (FileType fileType : FileType.values()) { for (FileType fileType : FileType.values()) {

@ -25,8 +25,8 @@ public enum IdType {
FEI_SHU_USER_ID(90, "fei_shu_user_id"), FEI_SHU_USER_ID(90, "fei_shu_user_id"),
; ;
private Integer code; private final Integer code;
private String description; private final String description;
} }

@ -24,8 +24,8 @@ public enum MessageStatus {
SEND_SUCCESS(60, "发送成功"), SEND_SUCCESS(60, "发送成功"),
SEND_FAIL(70, "发送失败"); SEND_FAIL(70, "发送失败");
private Integer code; private final Integer code;
private String description; private final String description;
} }

@ -21,18 +21,18 @@ public enum MessageType {
/** /**
* *
*/ */
private Integer code; private final Integer code;
/** /**
* *
*/ */
private String description; private final String description;
/** /**
* *
*/ */
private String codeEn; private final String codeEn;
/** /**

@ -33,28 +33,28 @@ public enum SendMessageType {
; ;
private String code; private final String code;
private String description; private final String description;
/** /**
* *
*/ */
private String dingDingRobotType; private final String dingDingRobotType;
/** /**
* *
*/ */
private String dingDingWorkType; private final String dingDingWorkType;
/** /**
* *
*/ */
private String enterpriseWeChatRobotType; private final String enterpriseWeChatRobotType;
/** /**
* *
*/ */
private String feiShuRobotType; private final String feiShuRobotType;
/** /**

@ -19,8 +19,8 @@ public enum ShieldType {
NIGHT_SHIELD(20, "夜间屏蔽"), NIGHT_SHIELD(20, "夜间屏蔽"),
NIGHT_SHIELD_BUT_NEXT_DAY_SEND(30, "夜间屏蔽(次日早上9点发送)"); NIGHT_SHIELD_BUT_NEXT_DAY_SEND(30, "夜间屏蔽(次日早上9点发送)");
private Integer code; private final Integer code;
private String description; private final String description;

@ -18,8 +18,8 @@ public enum SmsStatus {
RECEIVE_FAIL(30, "用户收不到短信(收到渠道短信回执,状态失败)"), RECEIVE_FAIL(30, "用户收不到短信(收到渠道短信回执,状态失败)"),
SEND_FAIL(40, "调用渠道接口发送失败"); SEND_FAIL(40, "调用渠道接口发送失败");
private Integer code; private final Integer code;
private String description; private final String description;
/** /**

@ -17,8 +17,8 @@ public enum SmsSupplier {
TENCENT(10,"腾讯渠道商"), TENCENT(10,"腾讯渠道商"),
YUN_PAIN(20,"云片渠道商"); YUN_PAIN(20,"云片渠道商");
private Integer code; private final Integer code;
private String description; private final String description;
/** /**

@ -17,7 +17,7 @@ public enum TemplateType {
REALTIME(20, "实时类的模板(接口实时调用)"), REALTIME(20, "实时类的模板(接口实时调用)"),
; ;
private Integer code; private final Integer code;
private String description; private final String description;
} }

@ -19,8 +19,8 @@ public enum RateLimitStrategy {
SEND_USER_NUM_RATE_LIMIT(20, "根据发送用户数限流"), SEND_USER_NUM_RATE_LIMIT(20, "根据发送用户数限流"),
; ;
private Integer code; private final Integer code;
private String description; private final String description;
} }

Loading…
Cancel
Save