Skip to content

Commit

Permalink
合并Develop分支,发布3.6.0正式版
Browse files Browse the repository at this point in the history
  • Loading branch information
binarywang authored Nov 24, 2019
2 parents a687654 + f00f5e6 commit 4759606
Show file tree
Hide file tree
Showing 296 changed files with 9,510 additions and 1,960 deletions.
6 changes: 2 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.binarywang</groupId>
<artifactId>wx-java</artifactId>
<version>3.5.0</version>
<version>3.6.0</version>
<packaging>pom</packaging>
<name>WxJava - Weixin/Wechat Java SDK</name>
<description>微信开发Java SDK</description>
Expand Down Expand Up @@ -105,9 +105,7 @@
<module>weixin-java-pay</module>
<module>weixin-java-miniapp</module>
<module>weixin-java-open</module>
<module>spring-boot-starters/wx-java-pay-spring-boot-starter</module>
<module>spring-boot-starters/wx-java-mp-spring-boot-starter</module>
<module>spring-boot-starters/wx-java-miniapp-spring-boot-starter</module>
<module>spring-boot-starters</module>
<!--module>weixin-java-osgi</module-->
</modules>

Expand Down
1 change: 0 additions & 1 deletion quality-checks/google_checks.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
<property name="max" value="120"/>
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
</module>
<module name="AvoidStarImport"/>
<module name="OneTopLevelClass"/>
<module name="NoLineWrap"/>
<module name="EmptyBlock">
Expand Down
45 changes: 45 additions & 0 deletions spring-boot-starters/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.github.binarywang</groupId>
<artifactId>wx-java</artifactId>
<version>3.6.0</version>
</parent>
<packaging>pom</packaging>
<artifactId>wx-java-spring-boot-starters</artifactId>
<name>WxJava - Spring Boot Starters</name>
<description>WxJava 各个模块的 Spring Boot Starter</description>

<properties>
<spring.boot.version>2.1.4.RELEASE</spring.boot.version>
</properties>

<modules>
<module>wx-java-miniapp-spring-boot-starter</module>
<module>wx-java-mp-spring-boot-starter</module>
<module>wx-java-pay-spring-boot-starter</module>
<module>wx-java-open-spring-boot-starter</module>
</modules>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
<version>${spring.boot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<version>${spring.boot.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
25 changes: 2 additions & 23 deletions spring-boot-starters/wx-java-miniapp-spring-boot-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,17 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>wx-java</artifactId>
<artifactId>wx-java-spring-boot-starters</artifactId>
<groupId>com.github.binarywang</groupId>
<version>3.5.0</version>
<relativePath>../../</relativePath>
<version>3.6.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

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

<properties>
<spring.boot.version>2.1.4.RELEASE</spring.boot.version>
</properties>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
<version>${spring.boot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<version>${spring.boot.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.github.binarywang</groupId>
<artifactId>weixin-java-miniapp</artifactId>
Expand Down
28 changes: 4 additions & 24 deletions spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,18 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>wx-java-spring-boot-starters</artifactId>
<groupId>com.github.binarywang</groupId>
<artifactId>wx-java</artifactId>
<version>3.5.0</version>
<relativePath>../../</relativePath>
<version>3.6.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

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

<properties>
<spring.boot.version>2.1.4.RELEASE</spring.boot.version>
</properties>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
<version>${spring.boot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<version>${spring.boot.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.github.binarywang</groupId>
<artifactId>weixin-java-mp</artifactId>
Expand All @@ -38,11 +22,7 @@
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
<scope>compile</scope>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
package com.binarywang.spring.starter.wxjava.mp.config;

import me.chanjar.weixin.mp.config.WxMpConfigStorage;
import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.api.*;
import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import me.chanjar.weixin.mp.config.WxMpConfigStorage;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

Expand All @@ -18,38 +14,118 @@
*/
@Configuration
public class WxMpServiceAutoConfiguration {
@Autowired
private ApplicationContext ctx;

@Bean
@ConditionalOnMissingBean
public WxMpService wxMpService(WxMpConfigStorage configStorage) {
WxMpService wxMpService = new WxMpServiceImpl();
wxMpService.setWxMpConfigStorage(configStorage);
registerWxMpSubService(wxMpService);
return wxMpService;
}

@ConditionalOnBean(WxMpService.class)
public Object registerWxMpSubService(WxMpService wxMpService) {
ConfigurableListableBeanFactory factory = (ConfigurableListableBeanFactory) ctx.getAutowireCapableBeanFactory();
factory.registerSingleton("wxMpKefuService", wxMpService.getKefuService());
factory.registerSingleton("wxMpMaterialService", wxMpService.getMaterialService());
factory.registerSingleton("wxMpMenuService", wxMpService.getMenuService());
factory.registerSingleton("wxMpUserService", wxMpService.getUserService());
factory.registerSingleton("wxMpUserTagService", wxMpService.getUserTagService());
factory.registerSingleton("wxMpQrcodeService", wxMpService.getQrcodeService());
factory.registerSingleton("wxMpCardService", wxMpService.getCardService());
factory.registerSingleton("wxMpDataCubeService", wxMpService.getDataCubeService());
factory.registerSingleton("wxMpUserBlacklistService", wxMpService.getBlackListService());
factory.registerSingleton("wxMpStoreService", wxMpService.getStoreService());
factory.registerSingleton("wxMpTemplateMsgService", wxMpService.getTemplateMsgService());
factory.registerSingleton("wxMpSubscribeMsgService", wxMpService.getSubscribeMsgService());
factory.registerSingleton("wxMpDeviceService", wxMpService.getDeviceService());
factory.registerSingleton("wxMpShakeService", wxMpService.getShakeService());
factory.registerSingleton("wxMpMemberCardService", wxMpService.getMemberCardService());
factory.registerSingleton("wxMpMassMessageService", wxMpService.getMassMessageService());
return Boolean.TRUE;
@Bean
public WxMpKefuService wxMpKefuService(WxMpService wxMpService) {
return wxMpService.getKefuService();
}

@Bean
public WxMpMaterialService wxMpMaterialService(WxMpService wxMpService) {
return wxMpService.getMaterialService();
}

@Bean
public WxMpMenuService wxMpMenuService(WxMpService wxMpService) {
return wxMpService.getMenuService();
}

@Bean
public WxMpUserService wxMpUserService(WxMpService wxMpService) {
return wxMpService.getUserService();
}

@Bean
public WxMpUserTagService wxMpUserTagService(WxMpService wxMpService) {
return wxMpService.getUserTagService();
}

@Bean
public WxMpQrcodeService wxMpQrcodeService(WxMpService wxMpService) {
return wxMpService.getQrcodeService();
}

@Bean
public WxMpCardService wxMpCardService(WxMpService wxMpService) {
return wxMpService.getCardService();
}

@Bean
public WxMpDataCubeService wxMpDataCubeService(WxMpService wxMpService) {
return wxMpService.getDataCubeService();
}

@Bean
public WxMpUserBlacklistService wxMpUserBlacklistService(WxMpService wxMpService) {
return wxMpService.getBlackListService();
}

@Bean
public WxMpStoreService wxMpStoreService(WxMpService wxMpService) {
return wxMpService.getStoreService();
}

@Bean
public WxMpTemplateMsgService wxMpTemplateMsgService(WxMpService wxMpService) {
return wxMpService.getTemplateMsgService();
}

@Bean
public WxMpSubscribeMsgService wxMpSubscribeMsgService(WxMpService wxMpService) {
return wxMpService.getSubscribeMsgService();
}

@Bean
public WxMpDeviceService wxMpDeviceService(WxMpService wxMpService) {
return wxMpService.getDeviceService();
}

@Bean
public WxMpShakeService wxMpShakeService(WxMpService wxMpService) {
return wxMpService.getShakeService();
}

@Bean
public WxMpMemberCardService wxMpMemberCardService(WxMpService wxMpService) {
return wxMpService.getMemberCardService();
}

@Bean
public WxMpMassMessageService wxMpMassMessageService(WxMpService wxMpService) {
return wxMpService.getMassMessageService();
}

@Bean
public WxMpAiOpenService wxMpAiOpenService(WxMpService wxMpService) {
return wxMpService.getAiOpenService();
}

@Bean
public WxMpWifiService wxMpWifiService(WxMpService wxMpService) {
return wxMpService.getWifiService();
}

@Bean
public WxMpMarketingService wxMpMarketingService(WxMpService wxMpService) {
return wxMpService.getMarketingService();
}

@Bean
public WxMpCommentService wxMpCommentService(WxMpService wxMpService) {
return wxMpService.getCommentService();
}

@Bean
public WxMpOcrService wxMpOcrService(WxMpService wxMpService) {
return wxMpService.getOcrService();
}

}
34 changes: 34 additions & 0 deletions spring-boot-starters/wx-java-open-spring-boot-starter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# wx-java-open-spring-boot-starter
## 快速开始
1. 引入依赖
```xml
<dependency>
<groupId>com.github.binarywang</groupId>
<artifactId>wx-java-open-spring-boot-starter</artifactId>
<version>${version}</version>
</dependency>
```
2. 添加配置(application.properties)
```
# 开放平台配置(必填)
wx.open.appId = @appId
wx.open.secret = @secret
wx.open.token = @token
wx.open.aesKey = @aesKey
# 存储配置redis(可选), 优先使用(wx.open.config-storage.redis)配置的redis, 支持自定注入的JedisPool
wx.open.config-storage.type = redis # 可选值, memory(默认), redis
wx.open.config-storage.redis.host = 127.0.0.1
wx.open.config-storage.redis.port = 6379
```
3. 支持自动注入的类型: `WxOpenService, WxOpenMessageRouter, WxOpenComponentService`

4. 覆盖自动配置: 自定义注入的bean会覆盖自动注入的
- WxOpenConfigStorage
- WxOpenService







Loading

0 comments on commit 4759606

Please sign in to comment.