Skip to content

Commit 4759606

Browse files
authored
合并Develop分支,发布3.6.0正式版
2 parents a687654 + f00f5e6 commit 4759606

File tree

296 files changed

+9510
-1960
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

296 files changed

+9510
-1960
lines changed

‎pom.xml‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<modelVersion>4.0.0</modelVersion>
77
<groupId>com.github.binarywang</groupId>
88
<artifactId>wx-java</artifactId>
9-
<version>3.5.0</version>
9+
<version>3.6.0</version>
1010
<packaging>pom</packaging>
1111
<name>WxJava - Weixin/Wechat Java SDK</name>
1212
<description>微信开发Java SDK</description>
@@ -105,9 +105,7 @@
105105
<module>weixin-java-pay</module>
106106
<module>weixin-java-miniapp</module>
107107
<module>weixin-java-open</module>
108-
<module>spring-boot-starters/wx-java-pay-spring-boot-starter</module>
109-
<module>spring-boot-starters/wx-java-mp-spring-boot-starter</module>
110-
<module>spring-boot-starters/wx-java-miniapp-spring-boot-starter</module>
108+
<module>spring-boot-starters</module>
111109
<!--module>weixin-java-osgi</module-->
112110
</modules>
113111

‎quality-checks/google_checks.xml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
<propertyname="max"value="120"/>
2828
<propertyname="ignorePattern"value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
2929
</module>
30-
<modulename="AvoidStarImport"/>
3130
<modulename="OneTopLevelClass"/>
3231
<modulename="NoLineWrap"/>
3332
<modulename="EmptyBlock">

‎spring-boot-starters/pom.xml‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?xml version="1.0"?>
2+
<projectxmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
4+
xmlns="http://maven.apache.org/POM/4.0.0">
5+
<modelVersion>4.0.0</modelVersion>
6+
<parent>
7+
<groupId>com.github.binarywang</groupId>
8+
<artifactId>wx-java</artifactId>
9+
<version>3.6.0</version>
10+
</parent>
11+
<packaging>pom</packaging>
12+
<artifactId>wx-java-spring-boot-starters</artifactId>
13+
<name>WxJava - Spring Boot Starters</name>
14+
<description>WxJava 各个模块的 Spring Boot Starter</description>
15+
16+
<properties>
17+
<spring.boot.version>2.1.4.RELEASE</spring.boot.version>
18+
</properties>
19+
20+
<modules>
21+
<module>wx-java-miniapp-spring-boot-starter</module>
22+
<module>wx-java-mp-spring-boot-starter</module>
23+
<module>wx-java-pay-spring-boot-starter</module>
24+
<module>wx-java-open-spring-boot-starter</module>
25+
</modules>
26+
27+
<dependencies>
28+
<dependency>
29+
<groupId>org.springframework.boot</groupId>
30+
<artifactId>spring-boot-autoconfigure</artifactId>
31+
<version>${spring.boot.version}</version>
32+
</dependency>
33+
<dependency>
34+
<groupId>org.springframework.boot</groupId>
35+
<artifactId>spring-boot-configuration-processor</artifactId>
36+
<version>${spring.boot.version}</version>
37+
<optional>true</optional>
38+
</dependency>
39+
<dependency>
40+
<groupId>org.projectlombok</groupId>
41+
<artifactId>lombok</artifactId>
42+
<scope>provided</scope>
43+
</dependency>
44+
</dependencies>
45+
</project>

‎spring-boot-starters/wx-java-miniapp-spring-boot-starter/pom.xml‎

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,17 @@
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<parent>
6-
<artifactId>wx-java</artifactId>
6+
<artifactId>wx-java-spring-boot-starters</artifactId>
77
<groupId>com.github.binarywang</groupId>
8-
<version>3.5.0</version>
9-
<relativePath>../../</relativePath>
8+
<version>3.6.0</version>
109
</parent>
1110
<modelVersion>4.0.0</modelVersion>
1211

1312
<artifactId>wx-java-miniapp-spring-boot-starter</artifactId>
1413
<name>WxJava - Spring Boot Starter for MiniApp</name>
1514
<description>微信小程序开发的 Spring Boot Starter</description>
1615

17-
<properties>
18-
<spring.boot.version>2.1.4.RELEASE</spring.boot.version>
19-
</properties>
20-
2116
<dependencies>
22-
<dependency>
23-
<groupId>org.springframework.boot</groupId>
24-
<artifactId>spring-boot-autoconfigure</artifactId>
25-
<version>${spring.boot.version}</version>
26-
</dependency>
27-
<dependency>
28-
<groupId>org.springframework.boot</groupId>
29-
<artifactId>spring-boot-configuration-processor</artifactId>
30-
<version>${spring.boot.version}</version>
31-
<optional>true</optional>
32-
</dependency>
33-
<dependency>
34-
<groupId>org.projectlombok</groupId>
35-
<artifactId>lombok</artifactId>
36-
<scope>provided</scope>
37-
</dependency>
3817
<dependency>
3918
<groupId>com.github.binarywang</groupId>
4019
<artifactId>weixin-java-miniapp</artifactId>

‎spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml‎

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,18 @@
22
<projectxmlns="http://maven.apache.org/POM/4.0.0"
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5-
<modelVersion>4.0.0</modelVersion>
65
<parent>
6+
<artifactId>wx-java-spring-boot-starters</artifactId>
77
<groupId>com.github.binarywang</groupId>
8-
<artifactId>wx-java</artifactId>
9-
<version>3.5.0</version>
10-
<relativePath>../../</relativePath>
8+
<version>3.6.0</version>
119
</parent>
10+
<modelVersion>4.0.0</modelVersion>
1211

1312
<artifactId>wx-java-mp-spring-boot-starter</artifactId>
1413
<name>WxJava - Spring Boot Starter for MP</name>
1514
<description>微信公众号开发的 Spring Boot Starter</description>
1615

17-
<properties>
18-
<spring.boot.version>2.1.4.RELEASE</spring.boot.version>
19-
</properties>
20-
2116
<dependencies>
22-
<dependency>
23-
<groupId>org.springframework.boot</groupId>
24-
<artifactId>spring-boot-autoconfigure</artifactId>
25-
<version>${spring.boot.version}</version>
26-
</dependency>
27-
<dependency>
28-
<groupId>org.springframework.boot</groupId>
29-
<artifactId>spring-boot-configuration-processor</artifactId>
30-
<version>${spring.boot.version}</version>
31-
<optional>true</optional>
32-
</dependency>
3317
<dependency>
3418
<groupId>com.github.binarywang</groupId>
3519
<artifactId>weixin-java-mp</artifactId>
@@ -38,11 +22,7 @@
3822
<dependency>
3923
<groupId>redis.clients</groupId>
4024
<artifactId>jedis</artifactId>
41-
</dependency>
42-
<dependency>
43-
<groupId>org.projectlombok</groupId>
44-
<artifactId>lombok</artifactId>
45-
<scope>provided</scope>
25+
<scope>compile</scope>
4626
</dependency>
4727
</dependencies>
4828

Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
packagecom.binarywang.spring.starter.wxjava.mp.config;
22

3-
importme.chanjar.weixin.mp.config.WxMpConfigStorage;
4-
importme.chanjar.weixin.mp.api.WxMpService;
3+
importme.chanjar.weixin.mp.api.*;
54
importme.chanjar.weixin.mp.api.impl.WxMpServiceImpl;
6-
importorg.springframework.beans.factory.annotation.Autowired;
7-
importorg.springframework.beans.factory.config.ConfigurableListableBeanFactory;
8-
importorg.springframework.boot.autoconfigure.condition.ConditionalOnBean;
5+
importme.chanjar.weixin.mp.config.WxMpConfigStorage;
96
importorg.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
10-
importorg.springframework.context.ApplicationContext;
117
importorg.springframework.context.annotation.Bean;
128
importorg.springframework.context.annotation.Configuration;
139

@@ -18,38 +14,118 @@
1814
*/
1915
@Configuration
2016
publicclassWxMpServiceAutoConfiguration{
21-
@Autowired
22-
privateApplicationContextctx;
2317

2418
@Bean
2519
@ConditionalOnMissingBean
2620
publicWxMpServicewxMpService(WxMpConfigStorageconfigStorage){
2721
WxMpServicewxMpService = newWxMpServiceImpl();
2822
wxMpService.setWxMpConfigStorage(configStorage);
29-
registerWxMpSubService(wxMpService);
3023
returnwxMpService;
3124
}
3225

33-
@ConditionalOnBean(WxMpService.class)
34-
publicObjectregisterWxMpSubService(WxMpServicewxMpService){
35-
ConfigurableListableBeanFactoryfactory = (ConfigurableListableBeanFactory) ctx.getAutowireCapableBeanFactory();
36-
factory.registerSingleton("wxMpKefuService", wxMpService.getKefuService());
37-
factory.registerSingleton("wxMpMaterialService", wxMpService.getMaterialService());
38-
factory.registerSingleton("wxMpMenuService", wxMpService.getMenuService());
39-
factory.registerSingleton("wxMpUserService", wxMpService.getUserService());
40-
factory.registerSingleton("wxMpUserTagService", wxMpService.getUserTagService());
41-
factory.registerSingleton("wxMpQrcodeService", wxMpService.getQrcodeService());
42-
factory.registerSingleton("wxMpCardService", wxMpService.getCardService());
43-
factory.registerSingleton("wxMpDataCubeService", wxMpService.getDataCubeService());
44-
factory.registerSingleton("wxMpUserBlacklistService", wxMpService.getBlackListService());
45-
factory.registerSingleton("wxMpStoreService", wxMpService.getStoreService());
46-
factory.registerSingleton("wxMpTemplateMsgService", wxMpService.getTemplateMsgService());
47-
factory.registerSingleton("wxMpSubscribeMsgService", wxMpService.getSubscribeMsgService());
48-
factory.registerSingleton("wxMpDeviceService", wxMpService.getDeviceService());
49-
factory.registerSingleton("wxMpShakeService", wxMpService.getShakeService());
50-
factory.registerSingleton("wxMpMemberCardService", wxMpService.getMemberCardService());
51-
factory.registerSingleton("wxMpMassMessageService", wxMpService.getMassMessageService());
52-
returnBoolean.TRUE;
26+
@Bean
27+
publicWxMpKefuServicewxMpKefuService(WxMpServicewxMpService){
28+
returnwxMpService.getKefuService();
29+
}
30+
31+
@Bean
32+
publicWxMpMaterialServicewxMpMaterialService(WxMpServicewxMpService){
33+
returnwxMpService.getMaterialService();
34+
}
35+
36+
@Bean
37+
publicWxMpMenuServicewxMpMenuService(WxMpServicewxMpService){
38+
returnwxMpService.getMenuService();
39+
}
40+
41+
@Bean
42+
publicWxMpUserServicewxMpUserService(WxMpServicewxMpService){
43+
returnwxMpService.getUserService();
44+
}
45+
46+
@Bean
47+
publicWxMpUserTagServicewxMpUserTagService(WxMpServicewxMpService){
48+
returnwxMpService.getUserTagService();
49+
}
50+
51+
@Bean
52+
publicWxMpQrcodeServicewxMpQrcodeService(WxMpServicewxMpService){
53+
returnwxMpService.getQrcodeService();
54+
}
55+
56+
@Bean
57+
publicWxMpCardServicewxMpCardService(WxMpServicewxMpService){
58+
returnwxMpService.getCardService();
59+
}
60+
61+
@Bean
62+
publicWxMpDataCubeServicewxMpDataCubeService(WxMpServicewxMpService){
63+
returnwxMpService.getDataCubeService();
64+
}
65+
66+
@Bean
67+
publicWxMpUserBlacklistServicewxMpUserBlacklistService(WxMpServicewxMpService){
68+
returnwxMpService.getBlackListService();
69+
}
70+
71+
@Bean
72+
publicWxMpStoreServicewxMpStoreService(WxMpServicewxMpService){
73+
returnwxMpService.getStoreService();
74+
}
75+
76+
@Bean
77+
publicWxMpTemplateMsgServicewxMpTemplateMsgService(WxMpServicewxMpService){
78+
returnwxMpService.getTemplateMsgService();
79+
}
80+
81+
@Bean
82+
publicWxMpSubscribeMsgServicewxMpSubscribeMsgService(WxMpServicewxMpService){
83+
returnwxMpService.getSubscribeMsgService();
84+
}
85+
86+
@Bean
87+
publicWxMpDeviceServicewxMpDeviceService(WxMpServicewxMpService){
88+
returnwxMpService.getDeviceService();
89+
}
90+
91+
@Bean
92+
publicWxMpShakeServicewxMpShakeService(WxMpServicewxMpService){
93+
returnwxMpService.getShakeService();
94+
}
95+
96+
@Bean
97+
publicWxMpMemberCardServicewxMpMemberCardService(WxMpServicewxMpService){
98+
returnwxMpService.getMemberCardService();
99+
}
100+
101+
@Bean
102+
publicWxMpMassMessageServicewxMpMassMessageService(WxMpServicewxMpService){
103+
returnwxMpService.getMassMessageService();
104+
}
105+
106+
@Bean
107+
publicWxMpAiOpenServicewxMpAiOpenService(WxMpServicewxMpService){
108+
returnwxMpService.getAiOpenService();
109+
}
110+
111+
@Bean
112+
publicWxMpWifiServicewxMpWifiService(WxMpServicewxMpService){
113+
returnwxMpService.getWifiService();
114+
}
115+
116+
@Bean
117+
publicWxMpMarketingServicewxMpMarketingService(WxMpServicewxMpService){
118+
returnwxMpService.getMarketingService();
119+
}
120+
121+
@Bean
122+
publicWxMpCommentServicewxMpCommentService(WxMpServicewxMpService){
123+
returnwxMpService.getCommentService();
124+
}
125+
126+
@Bean
127+
publicWxMpOcrServicewxMpOcrService(WxMpServicewxMpService){
128+
returnwxMpService.getOcrService();
53129
}
54130

55131
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# wx-java-open-spring-boot-starter
2+
## 快速开始
3+
1. 引入依赖
4+
```xml
5+
<dependency>
6+
<groupId>com.github.binarywang</groupId>
7+
<artifactId>wx-java-open-spring-boot-starter</artifactId>
8+
<version>${version}</version>
9+
</dependency>
10+
```
11+
2. 添加配置(application.properties)
12+
```
13+
# 开放平台配置(必填)
14+
wx.open.appId = @appId
15+
wx.open.secret = @secret
16+
wx.open.token = @token
17+
wx.open.aesKey = @aesKey
18+
# 存储配置redis(可选), 优先使用(wx.open.config-storage.redis)配置的redis, 支持自定注入的JedisPool
19+
wx.open.config-storage.type = redis # 可选值, memory(默认), redis
20+
wx.open.config-storage.redis.host = 127.0.0.1
21+
wx.open.config-storage.redis.port = 6379
22+
```
23+
3. 支持自动注入的类型: `WxOpenService, WxOpenMessageRouter, WxOpenComponentService`
24+
25+
4. 覆盖自动配置: 自定义注入的bean会覆盖自动注入的
26+
- WxOpenConfigStorage
27+
- WxOpenService
28+
29+
30+
31+
32+
33+
34+

0 commit comments

Comments
(0)