// Path: src/main/java/org/myazure/weixin/constant/MyazureConstants.java
// public class MyazureConstants {
// 	public static final String LOG_SPLIT_LINE = "========================MYAZURE====SPLIT====LINE========================";
// 	public static final String MYAZURE_WEIXIN_ADMIN_APPID="wx86c66f041e334ba4";
// 	public static final String MYAZURE_WEIXIN_ADMIN_APPSECRET="dbee2c24cc0dd3c8bb0805de2f4e4606";
// 	public static final String MYAZURE_WEIXIN_ADMIN_OPENID="o14wavxo7TN_zRBDD3c-mIigYR4U";
// 	
// 	public static String MYAZURE_SERVER_ID;
// 	public static String MYAZURE_APP_ID;
// 	public static String MYAZURE_APP_SECRET;
// 	public static String MYAZURE_ENCODE_TOKEN;
// 	public static String MYAZURE_ENCODE_KEY;
// 	public static String MYAZURE_APP_URL;
// 	public static String MYAZURE_COMPONENT_VERIFY_TICKET;
// 	public static String MYAZURE_COMPONENT_ACCESS_TOKEN;
// 	public static String MYAZURE_PRE_AUTH_CODE;
// 	public static WXBizMsgCrypt MYAZUZRE_WXBIZMSGCRYPT;
// 	
// 	public static final String ERR_OA_NOT_FOUNDED="OfficalAccountNotFound";
// 	
// }
// 
// Path: src/main/java/org/myazure/weixin/constant/WeixinConstans.java
// public class WeixinConstans {
// 	public static ExpireKey expireKey = new DefaultExpireKey();
// 	public static final String BASE_WEIXIN_API_URI = "https://api.weixin.qq.com";
// 	public static final String PARAM_ACCESS_TOKEN = "access_token";
// 	public static final String TOKEN_STRING = "token";
// 	public static final String COMPONENT_ACCESS_TOKEN_KEY = "component.access.token";
// 	public static final String PRE_AUTH_CODE_KEY = "pre.auth.code";
// 	public static final String AUTHORIZER_ACCESS_TOKEN_KEY = "authorizer.access.token";
// 	public static final String AUTHORIZER_REFRESH_TOKEN_KEY = "authorizer.refresh.token";
// 	// WECHAT MSG INFO
// 	public static final int FUNCTION_MSG_MANAGEMENT = 1;// 消息管理权限
// 	public static final int FUNCTION_USER_MANAGEMENT = 2;
// 	public static final int FUNCTION_ACCOUNT_SERVICE_MANAGEMENT = 3;
// 	public static final int FUNCTION_WEB_SERVICE_MANAGEMENT = 4;
// 	public static final int FUNCTION_WEIXIN_STORE_MANAGEMENT = 5;
// 	public static final int FUNCTION_VICTOR_CUSTORMER_SERVICE_MANAGEMENT = 6;
// 	public static final int FUNCTION_MASS_NOTIFICATION_MANAGEMENT = 7;
// 	public static final int FUNCTION_WEIXIN_CARD_MANAGEMENT = 8;
// 	public static final int FUNCTION_SWEEP_MANAGEMENT = 9;
// 	public static final int FUNCTION_EVEN_FIWI_MANAGEMENT = 10;
// 	public static final int FUNCTION_MATERIAL_MANAGEMENT = 11;
// 	public static final int FUNCTION_WECHAT_SHAKE_PERIPHERAL_MANAGEMENT = 12;
// 	public static final int FUNCTION_WECHAT_STORE_MANAGEMENT = 13;
// 	public static final int FUNCTION_PAYMENT_MANAGEMENT = 14;
// 	public static final int FUNCTION_CUSTOM_MENU_MANAGEMENT = 15;
// }


import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import org.myazure.weixin.constant.MyazureConstants;
import org.myazure.weixin.constant.WeixinConstans;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;
import com.qq.weixin.mp.aes.AesException;
import com.qq.weixin.mp.aes.WXBizMsgCrypt;
import weixin.popular.api.API;
import weixin.popular.client.LocalHttpClient;
import weixin.popular.support.TokenManager;
package org.myazure.weixin.lisenner;





/**
 * Token 监听器
 * 
 * @author WangZhen
 *
 */
@Component("servletContextListener")
public class SystemInitListener implements ServletContextListener {
	private static final Logger LOG = LoggerFactory.getLogger(SystemInitListener.class);
	@Value("${weixin.compAppId}")
	protected String MYAZURE_APP_ID;
	@Value("${weixin.compAppSecret}")
	protected String MYAZURE_APP_SECRET;
	@Value("${weixin.encode.token}")
	protected String MYAZURE_ENCODE_TOKEN;
	@Value("${weixin.encode.key}")
	protected String MYAZURE_ENCODE_KEY;
	@Value("${myazure.appUrl}")
	protected String MYAZURE_APP_URL;
	@Value("${myazure.serverId}")
	protected String MYAZURE_SERVER_ID;
	@Autowired
	private StringRedisTemplate redisTemplate;
	@Override
	public void contextInitialized(ServletContextEvent sce) {
// Path: src/main/java/org/myazure/weixin/constant/MyazureConstants.java
// public class MyazureConstants {
// 	public static final String LOG_SPLIT_LINE = "========================MYAZURE====SPLIT====LINE========================";
// 	public static final String MYAZURE_WEIXIN_ADMIN_APPID="wx86c66f041e334ba4";
// 	public static final String MYAZURE_WEIXIN_ADMIN_APPSECRET="dbee2c24cc0dd3c8bb0805de2f4e4606";
// 	public static final String MYAZURE_WEIXIN_ADMIN_OPENID="o14wavxo7TN_zRBDD3c-mIigYR4U";
// 	
// 	public static String MYAZURE_SERVER_ID;
// 	public static String MYAZURE_APP_ID;
// 	public static String MYAZURE_APP_SECRET;
// 	public static String MYAZURE_ENCODE_TOKEN;
// 	public static String MYAZURE_ENCODE_KEY;
// 	public static String MYAZURE_APP_URL;
// 	public static String MYAZURE_COMPONENT_VERIFY_TICKET;
// 	public static String MYAZURE_COMPONENT_ACCESS_TOKEN;
// 	public static String MYAZURE_PRE_AUTH_CODE;
// 	public static WXBizMsgCrypt MYAZUZRE_WXBIZMSGCRYPT;
// 	
// 	public static final String ERR_OA_NOT_FOUNDED="OfficalAccountNotFound";
// 	
// }
// 
// Path: src/main/java/org/myazure/weixin/constant/WeixinConstans.java
// public class WeixinConstans {
// 	public static ExpireKey expireKey = new DefaultExpireKey();
// 	public static final String BASE_WEIXIN_API_URI = "https://api.weixin.qq.com";
// 	public static final String PARAM_ACCESS_TOKEN = "access_token";
// 	public static final String TOKEN_STRING = "token";
// 	public static final String COMPONENT_ACCESS_TOKEN_KEY = "component.access.token";
// 	public static final String PRE_AUTH_CODE_KEY = "pre.auth.code";
// 	public static final String AUTHORIZER_ACCESS_TOKEN_KEY = "authorizer.access.token";
// 	public static final String AUTHORIZER_REFRESH_TOKEN_KEY = "authorizer.refresh.token";
// 	// WECHAT MSG INFO
// 	public static final int FUNCTION_MSG_MANAGEMENT = 1;// 消息管理权限
// 	public static final int FUNCTION_USER_MANAGEMENT = 2;
// 	public static final int FUNCTION_ACCOUNT_SERVICE_MANAGEMENT = 3;
// 	public static final int FUNCTION_WEB_SERVICE_MANAGEMENT = 4;
// 	public static final int FUNCTION_WEIXIN_STORE_MANAGEMENT = 5;
// 	public static final int FUNCTION_VICTOR_CUSTORMER_SERVICE_MANAGEMENT = 6;
// 	public static final int FUNCTION_MASS_NOTIFICATION_MANAGEMENT = 7;
// 	public static final int FUNCTION_WEIXIN_CARD_MANAGEMENT = 8;
// 	public static final int FUNCTION_SWEEP_MANAGEMENT = 9;
// 	public static final int FUNCTION_EVEN_FIWI_MANAGEMENT = 10;
// 	public static final int FUNCTION_MATERIAL_MANAGEMENT = 11;
// 	public static final int FUNCTION_WECHAT_SHAKE_PERIPHERAL_MANAGEMENT = 12;
// 	public static final int FUNCTION_WECHAT_STORE_MANAGEMENT = 13;
// 	public static final int FUNCTION_PAYMENT_MANAGEMENT = 14;
// 	public static final int FUNCTION_CUSTOM_MENU_MANAGEMENT = 15;
// }


// Path: src/main/java/org/myazure/weixin/lisenner/SystemInitListener.java
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import org.myazure.weixin.constant.MyazureConstants;
import org.myazure.weixin.constant.WeixinConstans;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;
import com.qq.weixin.mp.aes.AesException;
import com.qq.weixin.mp.aes.WXBizMsgCrypt;
import weixin.popular.api.API;
import weixin.popular.client.LocalHttpClient;
import weixin.popular.support.TokenManager;

package org.myazure.weixin.lisenner;





/**
 * Token 监听器
 * 
 * @author WangZhen
 *
 */
@Component("servletContextListener")
public class SystemInitListener implements ServletContextListener {
	private static final Logger LOG = LoggerFactory.getLogger(SystemInitListener.class);
	@Value("${weixin.compAppId}")
	protected String MYAZURE_APP_ID;
	@Value("${weixin.compAppSecret}")
	protected String MYAZURE_APP_SECRET;
	@Value("${weixin.encode.token}")
	protected String MYAZURE_ENCODE_TOKEN;
	@Value("${weixin.encode.key}")
	protected String MYAZURE_ENCODE_KEY;
	@Value("${myazure.appUrl}")
	protected String MYAZURE_APP_URL;
	@Value("${myazure.serverId}")
	protected String MYAZURE_SERVER_ID;
	@Autowired
	private StringRedisTemplate redisTemplate;
	@Override
	public void contextInitialized(ServletContextEvent sce) {
		MyazureConstants.MYAZURE_APP_ID = MYAZURE_APP_ID;