File tree Expand file tree Collapse file tree 3 files changed +18
-8
lines changed
java/com/github/binarywang/demo/wx/mp/config Expand file tree Collapse file tree 3 files changed +18
-8
lines changed Original file line number Diff line number Diff line change 18
18
<description >基于 WxJava 和 Spring Boot 实现的微信公众号后端开发演示项目</description >
19
19
20
20
<properties >
21
- <weixin-java-mp .version>3.8.0 </weixin-java-mp .version>
21
+ <weixin-java-mp .version>3.8.9.B </weixin-java-mp .version>
22
22
23
23
<maven .compiler.source>1.8</maven .compiler.source>
24
24
<maven .compiler.target>1.8</maven .compiler.target>
66
66
<dependency >
67
67
<groupId >redis.clients</groupId >
68
68
<artifactId >jedis</artifactId >
69
- <version >2.9 .0</version >
69
+ <version >3.3 .0</version >
70
70
</dependency >
71
71
72
+ <dependency >
73
+ <groupId >com.github.jedis-lock</groupId >
74
+ <artifactId >jedis-lock</artifactId >
75
+ <version >1.0.0</version >
76
+ </dependency >
72
77
<dependency >
73
78
<groupId >org.springframework.boot</groupId >
74
79
<artifactId >spring-boot-configuration-processor</artifactId >
Original file line number Diff line number Diff line change 2
2
3
3
import com .github .binarywang .demo .wx .mp .handler .*;
4
4
import lombok .AllArgsConstructor ;
5
+ import me .chanjar .weixin .common .redis .JedisWxRedisOps ;
5
6
import me .chanjar .weixin .mp .api .WxMpMessageRouter ;
6
7
import me .chanjar .weixin .mp .api .WxMpService ;
7
8
import me .chanjar .weixin .mp .api .impl .WxMpServiceImpl ;
8
9
import me .chanjar .weixin .mp .config .impl .WxMpDefaultConfigImpl ;
10
+ import me .chanjar .weixin .mp .config .impl .WxMpRedisConfigImpl ;
9
11
import org .springframework .boot .context .properties .EnableConfigurationProperties ;
10
12
import org .springframework .context .annotation .Bean ;
11
13
import org .springframework .context .annotation .Configuration ;
14
+ import redis .clients .jedis .JedisPool ;
12
15
13
16
import java .util .List ;
14
17
import java .util .stream .Collectors ;
@@ -53,7 +56,9 @@ public WxMpService wxMpService() {
53
56
WxMpService service = new WxMpServiceImpl ();
54
57
service .setMultiConfigStorages (configs
55
58
.stream ().map (a -> {
56
- WxMpDefaultConfigImpl configStorage = new WxMpDefaultConfigImpl ();
59
+ // WxMpDefaultConfigImpl configStorage = new WxMpDefaultConfigImpl();
60
+ WxMpDefaultConfigImpl configStorage = new WxMpRedisConfigImpl (new JedisWxRedisOps (new JedisPool ("redisServer" )),
61
+ a .getAppId ());
57
62
configStorage .setAppId (a .getAppId ());
58
63
configStorage .setSecret (a .getSecret ());
59
64
configStorage .setToken (a .getToken ());
Original file line number Diff line number Diff line change @@ -6,11 +6,11 @@ logging:
6
6
wx:
7
7
mp:
8
8
configs:
9
- - appId: 1111 (一个公众号的appid)
10
- secret: 1111( 公众号的appsecret)
11
- token: 111 ( 接口配置里的Token值)
12
- aesKey: 111 ( 接口配置里的EncodingAESKey值)
13
- - appId: 2222 (另一个公众号的appid ,以下同上)
9
+ - appId: 1111 # 第一个公众号的appid
10
+ secret: 1111 # 公众号的appsecret
11
+ token: 111 # 接口配置里的Token值
12
+ aesKey: 111 # 接口配置里的EncodingAESKey值
13
+ - appId: 2222 # 第二个公众号的appid ,以下同上
14
14
secret: 1111
15
15
token: 111
16
16
aesKey: 111
You can’t perform that action at this time.
0 commit comments