|
@@ -1,5 +1,5 @@
|
|
|
/**
|
|
|
- * Copyright (c) 2011-2014, James Zhan 詹波 (jfinal@126.com).
|
|
|
+ * Copyright (c) 2017-2019, lt 北京中世康恺科技有限公司 (www.pacsonline.cn).
|
|
|
*
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
*/
|
|
@@ -12,6 +12,7 @@ import com.jfinal.config.Interceptors;
|
|
|
import com.jfinal.config.JFinalConfig;
|
|
|
import com.jfinal.config.Plugins;
|
|
|
import com.jfinal.config.Routes;
|
|
|
+import com.jfinal.core.JFinal;
|
|
|
import com.jfinal.kit.PropKit;
|
|
|
import com.jfinal.plugin.activerecord.ActiveRecordPlugin;
|
|
|
import com.jfinal.plugin.druid.DruidPlugin;
|
|
@@ -65,7 +66,7 @@ public class ZskkConfig extends JFinalConfig {
|
|
|
|
|
|
me.add("/msg", WeixinMsgController.class);
|
|
|
me.add("/api", WeixinApiController.class, "/api");
|
|
|
- me.add("/web", WebBridgeController.class);
|
|
|
+ me.add("/web", WebBridgeController.class);
|
|
|
}
|
|
|
|
|
|
public void configPlugin(Plugins me) {
|
|
@@ -79,8 +80,8 @@ public class ZskkConfig extends JFinalConfig {
|
|
|
|
|
|
// 所有配置在 MappingKit 中搞定
|
|
|
_MappingKit.mapping(arp);
|
|
|
-
|
|
|
- // 使用redis分布accessToken
|
|
|
+
|
|
|
+ // 使用redis分布accessToken
|
|
|
RedisPlugin redisPlugin = new RedisPlugin("weixin_patient", "127.0.0.1", 6379);
|
|
|
redisPlugin.setSerializer(JdkSerializer.me); // 需要使用fst高性能序列化的用户请删除这一行(Fst jar依赖请查看WIKI)
|
|
|
me.add(redisPlugin);
|
|
@@ -102,31 +103,47 @@ public class ZskkConfig extends JFinalConfig {
|
|
|
super.onStart();
|
|
|
// 支持redis存储access_token、js_ticket,需要先启动RedisPlugin
|
|
|
ApiConfigKit.setAccessTokenCache(new RedisAccessTokenCache("weixin_patient"));
|
|
|
-
|
|
|
- ApiConfig ac = new ApiConfig();
|
|
|
+ // 中世康恺电子胶片平台
|
|
|
+ ApiConfig ac_zskk = new ApiConfig();
|
|
|
// 配置微信 API 相关参数
|
|
|
- ac.setToken(PropKit.get("token"));
|
|
|
- ac.setAppId(PropKit.get("appId"));
|
|
|
- ac.setAppSecret(PropKit.get("appSecret"));
|
|
|
+ ac_zskk.setToken(PropKit.get("token_zskk"));
|
|
|
+ ac_zskk.setAppId(PropKit.get("appId_zskk"));
|
|
|
+ ac_zskk.setAppSecret(PropKit.get("appSecret_zskk"));
|
|
|
|
|
|
/**
|
|
|
* 是否对消息进行加密,对应于微信平台的消息加解密方式: 1:true进行加密且必须配置 encodingAesKey
|
|
|
* 2:false采用明文模式,同时也支持混合模式
|
|
|
*/
|
|
|
- ac.setEncryptMessage(Boolean.FALSE);
|
|
|
+ ac_zskk.setEncryptMessage(Boolean.FALSE);
|
|
|
|
|
|
/**
|
|
|
* 多个公众号时,重复调用ApiConfigKit.putApiConfig(ac)依次添加即可,第一个添加的是默认。
|
|
|
*/
|
|
|
- ApiConfigKit.putApiConfig(ac);
|
|
|
-
|
|
|
- ApiConfig ac2 = new ApiConfig();
|
|
|
-// 配置微信 API 相关参数
|
|
|
- ac2.setToken(PropKit.get("token"));
|
|
|
- ac2.setAppId("wxee1c68f8944d357b");
|
|
|
- ac2.setAppSecret("1bc0128b6bbb3907c3bcf4a1704f2a1f");
|
|
|
- ac2.setEncryptMessage(Boolean.FALSE);
|
|
|
- ApiConfigKit.putApiConfig(ac2);
|
|
|
+ ApiConfigKit.putApiConfig(ac_zskk);
|
|
|
+
|
|
|
+ // 黑龙江省电子胶片平台
|
|
|
+ ApiConfig ac_hlj = new ApiConfig();
|
|
|
+ ac_hlj.setToken(PropKit.get("token_hlj"));
|
|
|
+ ac_hlj.setAppId(PropKit.get("appId_hlj"));
|
|
|
+ ac_hlj.setAppSecret(PropKit.get("appSecret_hlj"));
|
|
|
+ ac_hlj.setEncryptMessage(Boolean.FALSE);
|
|
|
+ ApiConfigKit.putApiConfig(ac_hlj);
|
|
|
+
|
|
|
+ // 辽宁省电子胶片平台
|
|
|
+ ApiConfig ac_ln = new ApiConfig();
|
|
|
+ ac_ln.setToken(PropKit.get("token_ln"));
|
|
|
+ ac_ln.setAppId(PropKit.get("appId_ln"));
|
|
|
+ ac_ln.setAppSecret(PropKit.get("appSecret_ln"));
|
|
|
+ ac_ln.setEncryptMessage(Boolean.FALSE);
|
|
|
+ ApiConfigKit.putApiConfig(ac_ln);
|
|
|
+
|
|
|
+ // ceshi
|
|
|
+ ApiConfig ac_cs = new ApiConfig();
|
|
|
+ ac_cs.setToken(PropKit.get("token_cs"));
|
|
|
+ ac_cs.setAppId(PropKit.get("appId_cs"));
|
|
|
+ ac_cs.setAppSecret(PropKit.get("appSecret_cs"));
|
|
|
+ ac_ln.setEncryptMessage(Boolean.FALSE);
|
|
|
+ ApiConfigKit.putApiConfig(ac_cs);
|
|
|
|
|
|
/**
|
|
|
* 1.9 新增LocalTestTokenCache用于本地和线上同时使用一套appId时避免本地将线上AccessToken冲掉
|
|
@@ -148,10 +165,11 @@ public class ZskkConfig extends JFinalConfig {
|
|
|
ServiceFactory.init();
|
|
|
|
|
|
}
|
|
|
+
|
|
|
//
|
|
|
-// public static void main(String[] args) {
|
|
|
-// JFinal.start("src/main/webapp", 10000, "/", 5);
|
|
|
-// }
|
|
|
+// public static void main(String[] args) {
|
|
|
+// JFinal.start("src/main/webapp", 10000, "/", 5);
|
|
|
+// }
|
|
|
|
|
|
@Override
|
|
|
public void configEngine(Engine engine) {
|