From 2a643b85aefac6f3de2057b37797cc4e4f176ffa Mon Sep 17 00:00:00 2001 From: qi_liang Date: Wed, 20 Mar 2019 06:52:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=BE=AE=E4=BF=A1=E5=85=AC?= =?UTF-8?q?=E4=BC=97=E5=8F=B7=E6=9E=9A=E4=B8=BE=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cms/emun/WechatAccessTokenTypeEnum.java | 66 +++++++++++++++++++ .../com/lq/cms/emun/WechatInfoTypeEnum.java | 66 +++++++++++++++++++ 2 files changed, 132 insertions(+) create mode 100755 src/main/java/com/lq/cms/emun/WechatAccessTokenTypeEnum.java create mode 100755 src/main/java/com/lq/cms/emun/WechatInfoTypeEnum.java 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); + } + + + +}