Skip to content

Commit

Permalink
合并develop分支,发布最新正式版
Browse files Browse the repository at this point in the history
* art:证书类配置读取优化调整

* new:电商收付通二级商户进件

* art:微信服务商配置优化

* new:jsapi合单支付

* new:合单支付

* 🎨 #1733 微信支付服务商配置优化,增加服务商合单支付接口

* art:微信服务商配置优化

* new:jsapi合单支付

* new:合单支付

Co-authored-by: 曾浩 <epdcgsi@dingtalk.com>

* 🎨 优化代码

* 🎨 优化重构并统一公众号和小程序的spring boot starter部分配置类和属性

* 🎨 优化企业微信消息发送接口代码,引入moco模拟测试组件,方便测试代码

* 🎨 #1722 企业微信增加互联企业发送应用消息的接口,并重构消息相关类的包结构

* 🎨 优化代码,使用java8自带的Base64类

* 🐛 #1738 修复企业微信创建用户接口自定义字段缺失的问题

* 🎨 升级依赖的Spring Boot版本为最新,并优化部分代码

* 🔖  发布 3.9.1.B 测试版本

* 🎨 #1743 企业微信获取客户群详情接口增加unionId属性

获取客户群详情对象中 增加 unionId属性

* new:电商收付通普通支付

* 🆕 #1744 微信支付增加电商收付通-普通支付相关接口

* new:电商收付通普通支付

Co-authored-by: 曾浩 <epdcgsi@dingtalk.com>

* new:电商收付通支付回调处理

* new:电商收付通支付回调处理

* 🆕 #1749 微信支付增加电商收付通支付回调处理相关方法


* new:电商收付通支付回调处理

Co-authored-by: 曾浩 <epdcgsi@dingtalk.com>

* 🎨 #1752 微信支付电商收付通二级商户进件时店铺信息增加小程序appid字段

* 🎨 优化部分代码

* 电商收付通支付调整

* 🎨 电商收付通支付接口调整

经测试小程序支付时不能使用服务商的appId签名,故增加方法返回微信接口返回的结果。

* 🎨 #1756 解决wx-java-open-spring-boot-starter中Redisson实现缺少database设置的问题

* 🎨 #1753 小程序直播部分接口代码优化重构,对照官方文档补充新增参数

* 🎨 #1747 微信支付分回调通知对象类增加缺失参数:回调摘要summary

* 🆕 #1758 微信支付增加电商收付通服务商和二级商户余额查询接口

* 🆕 #1759 微信支付增加电商收付通请求分账接口

* 增加微信收付通请求分账接口

* 🆕 #1723 企业微信增加查询应用消息发送统计的接口

* 🔖 发布 3.9.2.B 测试版本

* 🆕 #1764 微信支付电商收付通增加请求分账回退接口

* 🐛 #1766 修复电商收付通请求分账结果类未添加相关注解的问题

* 微信收付通增加请求分账回退接口

* 修复请求分账结果未添加lombok注解

* fix:电商收付通回调通知测试

* 🆕 #1768 微信支付增加电商收付通完结分账和退款接口

* 微信收付通增加完结分账和退款接口

* 🆕 #1767 企业微信外部联系人增加修改客户备注信息的接口

* 🎨 优化部分代码

* 🎨 #1646 企业微信第三方应用(服务商)模块重构实现,并提供Router、Interceptor、Handler等接口

* 🎨 #1755 完善补充第三方平台小程序相关的部分错误码

* 🎨 优化企业微信群机器人发送消息的相关接口,提供无需提前设置webhookKey即可使用的重构方法

* 🆕 #1675 企业微信增加创建日历的接口,以及相关回调事件消息通知的支持

* 🔖 发布 3.9.3.B 测试版本

* new:电商收付通合单支付、普通支付查询

* new:电商收付通商户、平台提现

* fix:命名统一调整

* 🆕  #1772 电商收付通增加支付结果查询和提现的接口

* new:分账查询、退款通知

* new:修改结算账户、退款查询

* 🆕 #1775 微信支付电商收付通增加修改二级商户结算账户和退款查询的接口

* 🐛 #1777 XML工具类修复无法解析<ExtAttr><Item>这种节点数据的问题

* 🎨 WxMpMessageRouter增加构造方法

* 🎨 升级依赖jodd-http版本,并修复不兼容代码

* 🎨 优化GraalProcessor代码

* #1782 微信支付修复分账回退查询接口签名错误的问题

Co-authored-by: lmh <lmh@weiyian.com>

* 🆕 #1774 企业微信增加系统审批事件推送的事件常量

* 🎨 优化代码

* 🎨 #1785 公众号 spring boot starter 模块增加接口自定义主机地址和redis sentinel的配置

* 🔖  发布 3.9.4.B 测试版本

* fix:字段错误

* 🆕 #1789 微信支付电商收付通增加下载账单的接口

* 🆕 #1793 企业微信添加应用管理的设置工作台自定义展示模块 

Co-authored-by: sysong <sysong@chutianyun.gov.cn>

* 🎨 优化公众号Spring Boot Starter的redisTemplate注入等代码

* 🎨 优化代码,提供toString方法,避免某些情况下出现的问题

* 🆕 #1675 企业微信增加更新、查询和删除日历的接口

* 🆕 #1686 微信公众号增加对话能力(原导购助手)部分接口,如添加顾问、获取顾问信息等

* 🆕 #1686 微信公众号增加对话能力(原导购助手)部分接口,如修改顾问、删除顾问、获取顾问列表等

* 🎨 #1797 企业微信配置客户联系「联系我」方式接口返回增加二维码链接字段

新增联系我二维码链接,仅在scene为2时返回

* 🎨 优化部分代码,重构OAuth2网页授权、网页登录等相关接口,方便接入open模块

* 🐛  修复字段错误

Co-authored-by: 曾浩 <epdcgsi@dingtalk.com>

* 🆕 #1725 微信支付分增加免确认模式(预授权方式)相关接口支持

* 🆕 #1806 开放平台增加第三方平台代公众号实现复用公众号资料快速创建小程序的接口

* 🆕 微信开发平台模块增加OAuth2相关接口(网页授权、网页登录等)的实现

* 🎨 优化部分代码,明确出错信息

* 🔖 发布 3.9.5.B 测试版本

* 🆕 #1817 企业微信增加批量获取外部联系人详情的接口,同时修复外部联系人中listGroupChat参数失效问题

* 🎨 优化代码,实现序列化接口

* 🎨 #1820 优化更新getTicket方法,调整锁调用时机避免并发问题

* Fix:调整获取相关票据的锁处理时机

* Fix:更新票据,锁之后,再次检查是否有效,避免并发同时进入多次重置票据

Co-authored-by: weiwei.xing <weiwei.xing@nplusgroup.com>

* Update CONTRIBUTING.md

* 🆕 #1814 微信支付解析扫码支付回调通知增加签名类型的重载方法

* 🔖 发布 3.9.6.B 测试版本

* 🎨 重构部分包结构

* 🎨 #1827 微信支付分相关接口优化

1. 将原有请求模型类中一些基础数据类型改为对应的包装类,因为在用户没有显式set的情况下,这些基础数据类型序列化为json时也会以默认值的形式作为参数传到微信端,造成微信端返回错误。
2. 微信支付分相关的回调数据处理方法加上签名验证。
3. 增加方法授权/解除授权服务回调数据处理

* 🎨 #1832 微信支付电商收付通增加查询提现状态的接口

* 🐛 #1824 微信支付修复分账回退接口结果错误码解析错误的问题

* 🎨 #1834 微信会员卡基本信息类增加缺少字段 use_limit

* 🐛 #1828 修复企业微信第三方应用消息路由相关方法参数错误的问题

* 🆕 #1831 生成小程序二维码的相关接口增加指定文件路径参数的重载方法

* 🔖 发布 3.9.7.B 测试版本

* 🎨 #1848 刷卡支付接口响应结果类增加服务商调用时的返回字段

* 🎨 增加点注释

* 🎨 #1849 企业微信外部联系人相关接口重构,优化重复代码,同时获取客户详情接口返回增加标签id字段

* 🎨 Update javadoc for WxMaQrcodeService.java

* 🐛 #1852 修复个性化菜单clientPlatformType字段的反序列化问题

* 🎨 补充完善单元测试

* 🐛 #1856 【微信支付】修复电商收付通查询退款状态的接口地址

* 🎨 #1857 【企业微信】获取获取部门成员详情接口返回值增加第三方应用专有的open_userid字段

* 🔖 发布 3.9.8.B 测试版本

* 🎨 修复out_trade_no 字段命名不规范问题

Co-authored-by: vcpgfw <zhaopf@xtkg.com>

* 📝  add more cases

* 🐛 #1861【微信支付】支付分后付费项目请求类的amount属性改为Integer,允许为空

* 🐛 #1864 【微信支付】WxPayConfig类的hashCode和equals方法移除 verifier 字段

* 🆕 #1863 【小程序】增加删除直播间、编辑直播间、获取直播间推流地址、获取直播间分享二维码等接口

* 🎨 #1867【企业微信】优化完善第三方应用的接入代码

* 🆕 #1869 【小程序】增加管理直播间小助手的相关接口

* 🆕 #1868 【微信支付】增加通用上传图片接口,支持传入流和文件名参数

* 🎨 优化代码,部分类增加序列化接口实现

* 🎨 增加点单元测试示例代码

* 🔖 发布 3.9.9.B 测试版本

* ⬆️ 升级xstream版本

* ⬆️ Bump xstream

Bumps [xstream](https://github.com/x-stream/xstream) from 1.4.10-java7 to 1.4.13-java7.
- [Release notes](https://github.com/x-stream/xstream/releases)
- [Commits](https://github.com/x-stream/xstream/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* 🆕 #1873 【企业微信】第三方应用增加网页授权登陆获取访问用户身份和获取访问用户敏感信息的接口

* 🐛 修复字段错误问题

* 🐛 #1883【公众号】修复卡券导入code接口错误的返回类型

* 🎨 规范变量名

* 🆕  #1885 【微信支付】电商收付通增加资金账单下载的接口

* 🆕 #1866 【小程序】 增加提审素材上传接口请求执行器

* 🎨 重构规范小程序部分代码包结构

* 🎨 #1888【企业微信】补充完善OA审批回调事件消息部分字段缺失的问题

* 🆕 #1746: 【企业微信】第三方应用增加授权配置接口,同时增加向员工付款的接口

* 🎨 #1886 【小程序】创建直播间接口增加二维码地址字段

* 🔖 发布 4.0.0 正式版本

Co-authored-by: 曾浩 <epdcgsi@dingtalk.com>
Co-authored-by: cloudX <epdcgsi@163.com>
Co-authored-by: Boris <borisbao@users.noreply.github.com>
Co-authored-by: f00lish <f00lish@qq.com>
Co-authored-by: TomLiu <tomliuchangsha@hotmail.com>
Co-authored-by: giveme0101 <xiajun94@qq.com>
Co-authored-by: lmh <991564110@qq.com>
Co-authored-by: lmh <lmh@weiyian.com>
Co-authored-by: Dream2Land <346570926@qq.com>
Co-authored-by: amhere <songshiyu555@163.com>
Co-authored-by: sysong <sysong@chutianyun.gov.cn>
Co-authored-by: 静宏 <acvrock.cn@gmail.com>
Co-authored-by: spvycf <545997765@qq.com>
Co-authored-by: alucardxh <alucardxh@163.com>
Co-authored-by: jn老A <sytu_xww@163.com>
Co-authored-by: weiwei.xing <weiwei.xing@nplusgroup.com>
Co-authored-by: winter <winter4666@foxmail.com>
Co-authored-by: gentryhuang <gentryhuang.xw@gmail.com>
Co-authored-by: Kidwind <Kidwind@gmail.com>
Co-authored-by: zacks <zacksleo@gmail.com>
Co-authored-by: wcc1433 <37837522+wcc1433@users.noreply.github.com>
Co-authored-by: Pancras <coder.zpf@gmail.com>
Co-authored-by: vcpgfw <zhaopf@xtkg.com>
Co-authored-by: JoeWoo <xjoewoo@gmail.com>
Co-authored-by: 微同科技 <30375770+lipengjun92@users.noreply.github.com>
Co-authored-by: xworks <jzqlin@gmail.com>
Co-authored-by: GaoMinzhu <31923767+GaoMinzhu@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: huangxm129 <40385667+huangxm129@users.noreply.github.com>
Co-authored-by: ly8388 <49558207+ly8388@users.noreply.github.com>
Co-authored-by: yangyh22 <9944784+yangyh22@users.noreply.github.com>
Co-authored-by: Gyv12345 <gyv12345@163.com>
Co-authored-by: LinXiaoHuChong <louisquiet@gmail.com>
  • Loading branch information
1 parent 0bb343d commit d2f5adc
Show file tree
Hide file tree
Showing 423 changed files with 16,612 additions and 2,370 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,4 @@ sonar-project.properties

# STS
.factorypath
*.zip
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# 代码贡献指南
1. 首先非常欢迎和感谢对本项目发起Pull Request的同学
1. **特别提示:请务必在develop分支提交PR,master分支目前仅是正式版的代码,即发布正式版本后才会从develop分支进行合并**
1. 首先非常欢迎和感谢对本项目发起`Pull Request`的同学
1. **特别提示:请务必在 `develop` 分支提交 `PR``release` 分支目前仅是正式版的代码,即发布正式版本后才会从 `develop` 分支进行合并**
1. 本项目代码风格为使用2个空格代表一个Tab,因此在提交代码时请注意一下,否则很容易在IDE格式化代码后与原代码产生大量diff,这样会给其他人阅读代码带来极大的困扰。
1. 为了便于设置,本项目引入editorconfig支持,请使用Eclipse的同学在贡献代码前安装相关插件,而IntelliJ IDEA新版本自带支持,如果没有可自行安装插件。
1. 为了便于设置,本项目引入`editorconfig`支持,请使用Eclipse的同学在贡献代码前安装相关插件,`IntelliJ IDEA`新版本自带支持,如果没有可自行安装插件。
1. **提交代码前,请检查代码是否已经格式化,并且保证新增加或者修改的方法都有完整的参数说明,而public方法必须拥有相应的单元测试并通过测试。**
1. 本项目可以采用两种方式接受代码贡献:
- 第一种就是基于[Git Flow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow)开发流程,因此在发起Pull Request的时候请选择develop分支,详细步骤参考后文,推荐使用此种方式贡献代码。
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
- 维沃吼吼
- 王朝社区(比亚迪新能源社区)
- 极吼吼手机上门回收换新
- 未来信封


#### 公众号:
Expand All @@ -138,6 +139,7 @@
- YshopMall
- 好行景区直通车以及全国40多个公众号
- 我奥篮球公众号
- 未来信封官微

#### 企业号/企业微信:
- HTC企业微信
Expand Down
2 changes: 1 addition & 1 deletion others/weixin-java-osgi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.4.10-java7</version>
<version>1.4.13-java7</version>
<scope>provided</scope>
<exclusions>
<exclusion>
Expand Down
18 changes: 12 additions & 6 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.9.0</version>
<version>4.0.0</version>
<packaging>pom</packaging>
<name>WxJava - Weixin/Wechat Java SDK</name>
<description>微信开发Java SDK</description>
Expand Down Expand Up @@ -134,7 +134,7 @@
<dependency>
<groupId>org.jodd</groupId>
<artifactId>jodd-http</artifactId>
<version>5.1.6</version>
<version>5.2.0</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -172,17 +172,17 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.24</version>
<version>1.7.30</version>
</dependency>
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.4.11.1</version>
<version>1.4.14</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>29.0-android</version>
<version>29.0-jre</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
Expand Down Expand Up @@ -239,6 +239,12 @@
<version>3.0.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.dreamhead</groupId>
<artifactId>moco-runner</artifactId>
<version>1.1.0</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>redis.clients</groupId>
Expand All @@ -262,7 +268,7 @@
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-redis</artifactId>
<version>1.8.23.RELEASE</version>
<version>2.3.3.RELEASE</version>
<optional>true</optional>
<scope>provided</scope>
</dependency>
Expand Down
4 changes: 2 additions & 2 deletions spring-boot-starters/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
<parent>
<groupId>com.github.binarywang</groupId>
<artifactId>wx-java</artifactId>
<version>3.9.0</version>
<version>4.0.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>
<spring.boot.version>2.3.3.RELEASE</spring.boot.version>
</properties>

<modules>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>wx-java-spring-boot-starters</artifactId>
<groupId>com.github.binarywang</groupId>
<version>3.9.0</version>
<version>4.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import cn.binarywang.wx.miniapp.config.impl.WxMaDefaultConfigImpl;
import cn.binarywang.wx.miniapp.config.impl.WxMaRedisBetterConfigImpl;
import com.binarywang.spring.starter.wxjava.miniapp.enums.HttpClientType;
import com.binarywang.spring.starter.wxjava.miniapp.properties.RedisProperties;
import com.binarywang.spring.starter.wxjava.miniapp.properties.WxMaProperties;
import lombok.AllArgsConstructor;
import me.chanjar.weixin.common.redis.JedisWxRedisOps;
Expand Down Expand Up @@ -52,14 +53,19 @@ public class WxMaAutoConfiguration {
public WxMaService service(WxMaConfig wxMaConfig) {
HttpClientType httpClientType = wxMaProperties.getConfigStorage().getHttpClientType();
WxMaService wxMaService;
if (httpClientType == HttpClientType.OkHttp) {
wxMaService = new WxMaServiceOkHttpImpl();
} else if (httpClientType == HttpClientType.JoddHttp) {
wxMaService = new WxMaServiceJoddHttpImpl();
} else if (httpClientType == HttpClientType.HttpClient) {
wxMaService = new WxMaServiceHttpClientImpl();
} else {
wxMaService = new WxMaServiceImpl();
switch (httpClientType) {
case OkHttp:
wxMaService = new WxMaServiceOkHttpImpl();
break;
case JoddHttp:
wxMaService = new WxMaServiceJoddHttpImpl();
break;
case HttpClient:
wxMaService = new WxMaServiceHttpClientImpl();
break;
default:
wxMaService = new WxMaServiceImpl();
break;
}
wxMaService.setWxMaConfig(wxMaConfig);
return wxMaService;
Expand Down Expand Up @@ -102,7 +108,7 @@ private WxMaDefaultConfigImpl wxMaDefaultConfigStorage() {
}

private WxMaDefaultConfigImpl wxMaJedisConfigStorage() {
WxMaProperties.RedisProperties redisProperties = wxMaProperties.getConfigStorage().getRedis();
RedisProperties redisProperties = wxMaProperties.getConfigStorage().getRedis();
JedisPool jedisPool;
if (StringUtils.isNotEmpty(redisProperties.getHost())) {
JedisPoolConfig config = new JedisPoolConfig();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package com.binarywang.spring.starter.wxjava.miniapp.properties;

import lombok.Data;

/**
* redis 配置.
*
* @author <a href="https://github.com/binarywang">Binary Wang</a>
* @date 2020-08-30
*/
@Data
public class RedisProperties {

/**
* 主机地址.不填则从spring容器内获取JedisPool
*/
private String host;

/**
* 端口号.
*/
private int port = 6379;

/**
* 密码.
*/
private String password;

/**
* 超时.
*/
private int timeout = 2000;

/**
* 数据库.
*/
private int database = 0;

private Integer maxActive;
private Integer maxIdle;
private Integer maxWaitMillis;
private Integer minIdle;
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,37 +88,4 @@ public static class ConfigStorage {
private String httpProxyPassword;
}

@Data
public static class RedisProperties {

/**
* 主机地址.不填则从spring容器内获取JedisPool
*/
private String host;

/**
* 端口号.
*/
private int port = 6379;

/**
* 密码.
*/
private String password;

/**
* 超时.
*/
private int timeout = 2000;

/**
* 数据库.
*/
private int database = 0;

private Integer maxActive;
private Integer maxIdle;
private Integer maxWaitMillis;
private Integer minIdle;
}
}
11 changes: 9 additions & 2 deletions spring-boot-starters/wx-java-mp-spring-boot-starter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,23 @@
wx.mp.token = @token
wx.mp.aesKey = @aesKey
# 存储配置redis(可选)
wx.mp.config-storage.type = redis # 配置类型: memory(默认), redis, jedis, redistemplate
wx.mp.config-storage.type = Jedis # 配置类型: Memory(默认), Jedis, RedisTemplate
wx.mp.config-storage.key-prefix = wx # 相关redis前缀配置: wx(默认)
wx.mp.config-storage.redis.host = 127.0.0.1
wx.mp.config-storage.redis.port = 6379
#单机和sentinel同时存在时,优先使用sentinel配置
#wx.mp.config-storage.redis.sentinel-ips=127.0.0.1:16379,127.0.0.1:26379
#wx.mp.config-storage.redis.sentinel-name=mymaster
# http客户端配置
wx.mp.config-storage.http-client-type=httpclient # http客户端类型: httpclient(默认), okhttp, joddhttp
wx.mp.config-storage.http-client-type=httpclient # http客户端类型: HttpClient(默认), OkHttp, JoddHttp
wx.mp.config-storage.http-proxy-host=
wx.mp.config-storage.http-proxy-port=
wx.mp.config-storage.http-proxy-username=
wx.mp.config-storage.http-proxy-password=
# 公众号地址host配置
#wx.mp.hosts.api-host=http://proxy.com/
#wx.mp.hosts.open-host=http://proxy.com/
#wx.mp.hosts.mp-host=http://proxy.com/
```
3. 自动注入的类型
- `WxMpService`
Expand Down
12 changes: 11 additions & 1 deletion spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>wx-java-spring-boot-starters</artifactId>
<groupId>com.github.binarywang</groupId>
<version>3.9.0</version>
<version>4.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -30,6 +30,16 @@
<version>${spring.boot.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jodd</groupId>
<artifactId>jodd-http</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.binarywang.spring.starter.wxjava.mp.config;

import com.binarywang.spring.starter.wxjava.mp.enums.HttpClientType;
import com.binarywang.spring.starter.wxjava.mp.properties.WxMpProperties;
import me.chanjar.weixin.common.api.WxOcrService;
import me.chanjar.weixin.mp.api.*;
import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.api.impl.WxMpServiceHttpClientImpl;
import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl;
import me.chanjar.weixin.mp.api.impl.WxMpServiceJoddHttpImpl;
Expand All @@ -23,16 +23,21 @@ public class WxMpServiceAutoConfiguration {
@Bean
@ConditionalOnMissingBean
public WxMpService wxMpService(WxMpConfigStorage configStorage, WxMpProperties wxMpProperties) {
WxMpProperties.HttpClientType httpClientType = wxMpProperties.getConfigStorage().getHttpClientType();
HttpClientType httpClientType = wxMpProperties.getConfigStorage().getHttpClientType();
WxMpService wxMpService;
if (httpClientType == WxMpProperties.HttpClientType.okhttp) {
wxMpService = newWxMpServiceOkHttpImpl();
} else if (httpClientType == WxMpProperties.HttpClientType.joddhttp) {
wxMpService = newWxMpServiceJoddHttpImpl();
} else if (httpClientType == WxMpProperties.HttpClientType.httpclient) {
wxMpService = newWxMpServiceHttpClientImpl();
} else {
wxMpService = newWxMpServiceImpl();
switch (httpClientType) {
case OkHttp:
wxMpService = newWxMpServiceOkHttpImpl();
break;
case JoddHttp:
wxMpService = newWxMpServiceJoddHttpImpl();
break;
case HttpClient:
wxMpService = newWxMpServiceHttpClientImpl();
break;
default:
wxMpService = newWxMpServiceImpl();
break;
}

wxMpService.setWxMpConfigStorage(configStorage);
Expand Down
Loading

0 comments on commit d2f5adc

Please sign in to comment.