diff --git a/src/main/java/com/lq/cms/emun/WechatAccessTokenTypeEnum.java b/src/main/java/com/lq/cms/emun/WechatAccessTokenTypeEnum.java new file mode 100755 index 0000000..2584d62 --- /dev/null +++ b/src/main/java/com/lq/cms/emun/WechatAccessTokenTypeEnum.java @@ -0,0 +1,66 @@ +package com.lq.cms.emun; + +import java.util.HashMap; +import java.util.Map; + +/** + * @Author: qi + * @Description: 微信公众号令牌类型 + * @Date: Create in 10:13 PM 2019/3/16 + */ +public enum WechatAccessTokenTypeEnum { + CURRENCY(1,"普通令牌"), + PAGE_AUTHORIZATION(2,"页面授权") + ; + + WechatAccessTokenTypeEnum(Integer value, String desc) { + this.value = value; + this.desc = desc; + } + + private Integer value; + + private String desc; + + public Integer getValue() { + return value; + } + + public void setValue(Integer value) { + this.value = value; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + private static Map enumMap = new HashMap<>(WechatAccessTokenTypeEnum.values().length); + + static { + WechatAccessTokenTypeEnum[] wechatAccessTokenTypeEnums = WechatAccessTokenTypeEnum.values(); + for (WechatAccessTokenTypeEnum wechatAccessTokenTypeEnum:wechatAccessTokenTypeEnums){ + enumMap.put(wechatAccessTokenTypeEnum.value,wechatAccessTokenTypeEnum.desc); + } + } + + public static boolean hasValue(int value){ + + return enumMap.containsKey(value); + } + + public static Map getEnumMap(){ + + return enumMap; + } + + public static String getDesc(int value){ + + return enumMap.get(value); + } + + +} diff --git a/src/main/java/com/lq/cms/emun/WechatInfoTypeEnum.java b/src/main/java/com/lq/cms/emun/WechatInfoTypeEnum.java new file mode 100755 index 0000000..76c10ce --- /dev/null +++ b/src/main/java/com/lq/cms/emun/WechatInfoTypeEnum.java @@ -0,0 +1,66 @@ +package com.lq.cms.emun; + +import java.util.HashMap; +import java.util.Map; + +/** + * @Author: qi + * @Description: 微信公众号类型枚举 + * @Date: Create in 9:44 AM 2019/3/15 + */ +public enum WechatInfoTypeEnum { + SUBSCRIBE(1,"订阅号"), + SERVICE(2,"服务号"), + ENTERPRISE(3,"企业号") + ; + WechatInfoTypeEnum(Integer value, String desc) { + this.value = value; + this.desc = desc; + } + private Integer value; + + private String desc; + + public Integer getValue() { + return value; + } + + public void setValue(Integer value) { + this.value = value; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + private static Map enumMap = new HashMap<>(WechatInfoTypeEnum.values().length); + + static { + WechatInfoTypeEnum[] wechatInfoTypeEnums = WechatInfoTypeEnum.values(); + for (WechatInfoTypeEnum wechatInfoTypeEnum:wechatInfoTypeEnums){ + enumMap.put(wechatInfoTypeEnum.value,wechatInfoTypeEnum.desc); + } + } + + public static boolean hasValue(int value){ + + return enumMap.containsKey(value); + } + + public static Map getEnumMap(){ + + return enumMap; + } + + public static String getDesc(int value){ + + return enumMap.get(value); + } + + + +}