|
|
@@ -3,49 +3,37 @@ package com.goafanti.common.enums;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.Map;
|
|
|
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
|
public enum BannersStatus {
|
|
|
|
|
|
- HOME( 1,"home"),
|
|
|
- OTHER(0, "other");
|
|
|
+ HOME( "home","首页"),
|
|
|
+ MAKEMONEY( "makeMoney","赚钱首页"),
|
|
|
+ OTHER( "other","其他");
|
|
|
|
|
|
- private BannersStatus(Integer code, String desc) {
|
|
|
- this.code = code;
|
|
|
+ private BannersStatus(String key, String desc) {
|
|
|
+ this.key = key;
|
|
|
this.desc = desc;
|
|
|
}
|
|
|
|
|
|
- private static Map<Integer, BannersStatus> status = new HashMap<Integer, BannersStatus>();
|
|
|
+ private static Map<String, BannersStatus> status = new HashMap<String, BannersStatus>();
|
|
|
|
|
|
static {
|
|
|
for (BannersStatus value : BannersStatus.values()) {
|
|
|
- status.put(value.getCode(), value);
|
|
|
+ status.put(value.getKey(), value);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static BannersStatus getStatus(Integer code) {
|
|
|
- if (containsType(code)) {
|
|
|
- return status.get(code);
|
|
|
- }
|
|
|
- return OTHER;
|
|
|
- }
|
|
|
-
|
|
|
- public static BannersStatus getStatus(String code) {
|
|
|
- if (StringUtils.isNumeric(code)) {
|
|
|
- return getStatus(Integer.parseInt(code));
|
|
|
- }
|
|
|
- return OTHER;
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
- public static boolean containsType(Integer code) {
|
|
|
- return status.containsKey(code);
|
|
|
+ public static boolean containsType(String key) {
|
|
|
+ return status.containsKey(key);
|
|
|
}
|
|
|
|
|
|
- private Integer code;
|
|
|
+ private String key;
|
|
|
private String desc;
|
|
|
|
|
|
- public Integer getCode() {
|
|
|
- return code;
|
|
|
+ public String getKey() {
|
|
|
+ return key;
|
|
|
}
|
|
|
|
|
|
public String getDesc() {
|