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
<property name="max" value="120"/>
2828
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
2929
</module>
30-
<module name="AvoidStarImport"/>
3130
<module name="OneTopLevelClass"/>
3231
<module name="NoLineWrap"/>
3332
<module name="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+
<project xmlns: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
<project xmlns="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
package com.binarywang.spring.starter.wxjava.mp.config;
22

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

@@ -18,38 +14,118 @@
1814
*/
1915
@Configuration
2016
public class WxMpServiceAutoConfiguration {
21-
@Autowired
22-
private ApplicationContext ctx;
2317

2418
@Bean
2519
@ConditionalOnMissingBean
2620
public WxMpService wxMpService(WxMpConfigStorage configStorage) {
2721
WxMpService wxMpService = new WxMpServiceImpl();
2822
wxMpService.setWxMpConfigStorage(configStorage);
29-
registerWxMpSubService(wxMpService);
3023
return wxMpService;
3124
}
3225

33-
@ConditionalOnBean(WxMpService.class)
34-
public Object registerWxMpSubService(WxMpService wxMpService) {
35-
ConfigurableListableBeanFactory factory = (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-
return Boolean.TRUE;
26+
@Bean
27+
public WxMpKefuService wxMpKefuService(WxMpService wxMpService) {
28+
return wxMpService.getKefuService();
29+
}
30+
31+
@Bean
32+
public WxMpMaterialService wxMpMaterialService(WxMpService wxMpService) {
33+
return wxMpService.getMaterialService();
34+
}
35+
36+
@Bean
37+
public WxMpMenuService wxMpMenuService(WxMpService wxMpService) {
38+
return wxMpService.getMenuService();
39+
}
40+
41+
@Bean
42+
public WxMpUserService wxMpUserService(WxMpService wxMpService) {
43+
return wxMpService.getUserService();
44+
}
45+
46+
@Bean
47+
public WxMpUserTagService wxMpUserTagService(WxMpService wxMpService) {
48+
return wxMpService.getUserTagService();
49+
}
50+
51+
@Bean
52+
public WxMpQrcodeService wxMpQrcodeService(WxMpService wxMpService) {
53+
return wxMpService.getQrcodeService();
54+
}
55+
56+
@Bean
57+
public WxMpCardService wxMpCardService(WxMpService wxMpService) {
58+
return wxMpService.getCardService();
59+
}
60+
61+
@Bean
62+
public WxMpDataCubeService wxMpDataCubeService(WxMpService wxMpService) {
63+
return wxMpService.getDataCubeService();
64+
}
65+
66+
@Bean
67+
public WxMpUserBlacklistService wxMpUserBlacklistService(WxMpService wxMpService) {
68+
return wxMpService.getBlackListService();
69+
}
70+
71+
@Bean
72+
public WxMpStoreService wxMpStoreService(WxMpService wxMpService) {
73+
return wxMpService.getStoreService();
74+
}
75+
76+
@Bean
77+
public WxMpTemplateMsgService wxMpTemplateMsgService(WxMpService wxMpService) {
78+
return wxMpService.getTemplateMsgService();
79+
}
80+
81+
@Bean
82+
public WxMpSubscribeMsgService wxMpSubscribeMsgService(WxMpService wxMpService) {
83+
return wxMpService.getSubscribeMsgService();
84+
}
85+
86+
@Bean
87+
public WxMpDeviceService wxMpDeviceService(WxMpService wxMpService) {
88+
return wxMpService.getDeviceService();
89+
}
90+
91+
@Bean
92+
public WxMpShakeService wxMpShakeService(WxMpService wxMpService) {
93+
return wxMpService.getShakeService();
94+
}
95+
96+
@Bean
97+
public WxMpMemberCardService wxMpMemberCardService(WxMpService wxMpService) {
98+
return wxMpService.getMemberCardService();
99+
}
100+
101+
@Bean
102+
public WxMpMassMessageService wxMpMassMessageService(WxMpService wxMpService) {
103+
return wxMpService.getMassMessageService();
104+
}
105+
106+
@Bean
107+
public WxMpAiOpenService wxMpAiOpenService(WxMpService wxMpService) {
108+
return wxMpService.getAiOpenService();
109+
}
110+
111+
@Bean
112+
public WxMpWifiService wxMpWifiService(WxMpService wxMpService) {
113+
return wxMpService.getWifiService();
114+
}
115+
116+
@Bean
117+
public WxMpMarketingService wxMpMarketingService(WxMpService wxMpService) {
118+
return wxMpService.getMarketingService();
119+
}
120+
121+
@Bean
122+
public WxMpCommentService wxMpCommentService(WxMpService wxMpService) {
123+
return wxMpService.getCommentService();
124+
}
125+
126+
@Bean
127+
public WxMpOcrService wxMpOcrService(WxMpService wxMpService) {
128+
return wxMpService.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)