Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
1812b23
art:证书类配置读取优化调整
Aug 17, 2020
2b27ee9
new:电商收付通二级商户进件
Aug 17, 2020
a3ec261
Merge branch 'develop' into develop
binarywang Aug 18, 2020
425b082
Merge branch 'master' into develop
binarywang Aug 23, 2020
cee3753
Merge remote-tracking branch 'wechat/develop' into develop
Aug 24, 2020
10e0ca5
art:微信服务商配置优化
Aug 24, 2020
5db9706
new:jsapi合单支付
Aug 24, 2020
e0d87eb
new:合单支付
Aug 26, 2020
6c490e3
:art: #1733 微信支付服务商配置优化,增加服务商合单支付接口
cloudX2019 Aug 29, 2020
84b9b99
Merge remote-tracking branch 'wechat/develop' into develop
Aug 30, 2020
64f7adc
:art: 优化代码
binarywang Aug 30, 2020
7cfabab
:art: 优化重构并统一公众号和小程序的spring boot starter部分配置类和属性
binarywang Aug 30, 2020
c01347c
:art: 优化企业微信消息发送接口代码,引入moco模拟测试组件,方便测试代码
binarywang Aug 30, 2020
53ad42e
:art: #1722 企业微信增加互联企业发送应用消息的接口,并重构消息相关类的包结构
binarywang Aug 30, 2020
541899a
Merge remote-tracking branch 'wechat/develop' into develop
Sep 4, 2020
31ecd4d
:art: 优化代码,使用java8自带的Base64类
binarywang Sep 4, 2020
07352d1
:bug: #1738 修复企业微信创建用户接口自定义字段缺失的问题
binarywang Sep 4, 2020
010b431
:art: 升级依赖的Spring Boot版本为最新,并优化部分代码
binarywang Sep 5, 2020
e04eaf4
:bookmark: 发布 3.9.1.B 测试版本
binarywang Sep 5, 2020
dfec2e3
:art: #1743 企业微信获取客户群详情接口增加unionId属性
borisbao Sep 7, 2020
9f60516
Merge remote-tracking branch 'wechat/develop' into develop
Sep 8, 2020
97409a7
new:电商收付通普通支付
Sep 8, 2020
9359885
:new: #1744 微信支付增加电商收付通-普通支付相关接口
cloudX2019 Sep 9, 2020
f18c62b
new:电商收付通支付回调处理
Sep 10, 2020
b8d9a15
Merge remote-tracking branch 'wechat/develop' into develop
Sep 10, 2020
c8fc670
new:电商收付通支付回调处理
Sep 10, 2020
6927eaa
:new: #1749 微信支付增加电商收付通支付回调处理相关方法
cloudX2019 Sep 10, 2020
0605761
:art: #1752 微信支付电商收付通二级商户进件时店铺信息增加小程序appid字段
f00lish Sep 10, 2020
7bf811a
:art: 优化部分代码
binarywang Sep 10, 2020
4f157b0
Merge remote-tracking branch 'wechat/develop' into develop
Sep 10, 2020
34f0d99
电商收付通支付调整
Sep 11, 2020
efdf64e
:art: 电商收付通支付接口调整
cloudX2019 Sep 11, 2020
c2552de
Merge remote-tracking branch 'wechat/develop' into develop
Sep 11, 2020
19b033c
:art: #1756 解决wx-java-open-spring-boot-starter中Redisson实现缺少database设…
stoneliu-coder Sep 12, 2020
ef0b34b
:art: #1753 小程序直播部分接口代码优化重构,对照官方文档补充新增参数
binarywang Sep 12, 2020
b15142a
:art: #1747 微信支付分回调通知对象类增加缺失参数:回调摘要summary
binarywang Sep 12, 2020
6c31059
:new: #1758 微信支付增加电商收付通服务商和二级商户余额查询接口
f00lish Sep 13, 2020
91d484f
:new: #1759 微信支付增加电商收付通请求分账接口
f00lish Sep 13, 2020
37a009c
:new: #1723 企业微信增加查询应用消息发送统计的接口
binarywang Sep 13, 2020
cc83bcb
:bookmark: 发布 3.9.2.B 测试版本
binarywang Sep 13, 2020
3fbeec4
Merge remote-tracking branch 'wechat/develop' into develop
Sep 14, 2020
7c10cdd
:new: #1764 微信支付电商收付通增加请求分账回退接口
f00lish Sep 14, 2020
e56289f
Merge remote-tracking branch 'wechat/develop' into develop
Sep 15, 2020
b660bfd
:bug: #1766 修复电商收付通请求分账结果类未添加相关注解的问题
f00lish Sep 17, 2020
60c63a5
fix:电商收付通回调通知测试
Sep 17, 2020
5b606fd
Merge remote-tracking branch 'wechat/develop' into develop
Sep 17, 2020
115f910
:new: #1768 微信支付增加电商收付通完结分账和退款接口
f00lish Sep 18, 2020
7261f23
:new: #1767 企业微信外部联系人增加修改客户备注信息的接口
binarywang Sep 19, 2020
e00320d
:art: 优化部分代码
binarywang Sep 19, 2020
cdda57d
:art: #1646 企业微信第三方应用(服务商)模块重构实现,并提供Router、Interceptor、Handler等接口
binarywang Sep 20, 2020
489942a
:art: #1755 完善补充第三方平台小程序相关的部分错误码
binarywang Sep 20, 2020
6713787
:art: 优化企业微信群机器人发送消息的相关接口,提供无需提前设置webhookKey即可使用的重构方法
binarywang Sep 20, 2020
1598c61
:new: #1675 企业微信增加创建日历的接口,以及相关回调事件消息通知的支持
binarywang Sep 20, 2020
020cd0a
:bookmark: 发布 3.9.3.B 测试版本
binarywang Sep 20, 2020
aa2fe98
Merge remote-tracking branch 'wechat/develop' into develop
Sep 20, 2020
9b20c74
new:电商收付通合单支付、普通支付查询
Sep 21, 2020
00bc965
new:电商收付通商户、平台提现
Sep 21, 2020
2037900
fix:命名统一调整
Sep 21, 2020
5f0d1b3
:new: #1772 电商收付通增加支付结果查询和提现的接口
cloudX2019 Sep 22, 2020
3b4bb74
Merge remote-tracking branch 'wechat/develop' into develop
Sep 22, 2020
58ac339
new:分账查询、退款通知
Sep 22, 2020
7df0e75
new:修改结算账户、退款查询
Sep 23, 2020
807ed7d
:new: #1775 微信支付电商收付通增加修改二级商户结算账户和退款查询的接口
cloudX2019 Sep 23, 2020
07edd5b
Merge remote-tracking branch 'wechat/develop' into develop
Sep 23, 2020
e0c995e
:bug: #1777 XML工具类修复无法解析<ExtAttr><Item>这种节点数据的问题
giveme0101 Sep 24, 2020
697a680
:art: WxMpMessageRouter增加构造方法
binarywang Sep 24, 2020
32f7277
:art: 升级依赖jodd-http版本,并修复不兼容代码
binarywang Sep 24, 2020
17583a4
:art: 优化GraalProcessor代码
binarywang Sep 24, 2020
f0f21e1
Merge remote-tracking branch 'wechat/develop' into develop
Sep 25, 2020
f212f02
#1782 微信支付修复分账回退查询接口签名错误的问题
lmhfq Sep 26, 2020
5ecfaf7
:new: #1774 企业微信增加系统审批事件推送的事件常量
binarywang Sep 26, 2020
1d73443
:art: 优化代码
binarywang Sep 26, 2020
a28a17a
Merge remote-tracking branch 'wechat/develop' into develop
Sep 27, 2020
7e3e16d
:art: #1785 公众号 spring boot starter 模块增加接口自定义主机地址和redis sentinel的配置
Dream2Land Sep 27, 2020
b797152
:bookmark: 发布 3.9.4.B 测试版本
binarywang Sep 27, 2020
d248c0e
fix:字段错误
Sep 28, 2020
9603199
Merge remote-tracking branch 'wechat/develop' into develop
Sep 28, 2020
429f170
:new: #1789 微信支付电商收付通增加下载账单的接口
f00lish Sep 29, 2020
cd0c63f
修改退款接口字段错误 (#1788)
binarywang Sep 29, 2020
8428270
:new: #1793 企业微信添加应用管理的设置工作台自定义展示模块
youflint Sep 30, 2020
8929fc4
:art: 优化公众号Spring Boot Starter的redisTemplate注入等代码
Dream2Land Oct 2, 2020
18f3f40
:art: 优化代码,提供toString方法,避免某些情况下出现的问题
binarywang Oct 5, 2020
64402ab
:new: #1675 企业微信增加更新、查询和删除日历的接口
binarywang Oct 5, 2020
6948044
:new: #1686 微信公众号增加对话能力(原导购助手)部分接口,如添加顾问、获取顾问信息等
binarywang Oct 6, 2020
9c91aeb
:new: #1686 微信公众号增加对话能力(原导购助手)部分接口,如修改顾问、删除顾问、获取顾问列表等
binarywang Oct 7, 2020
6cc5ebd
:art: #1797 企业微信配置客户联系「联系我」方式接口返回增加二维码链接字段
Acvrock Oct 12, 2020
c7b1abc
:art: 优化部分代码,重构OAuth2网页授权、网页登录等相关接口,方便接入open模块
binarywang Oct 10, 2020
5599c0d
:bug: 修复字段错误
cloudX2019 Oct 13, 2020
7c9e2e4
:new: #1725 微信支付分增加免确认模式(预授权方式)相关接口支持
spvycf Oct 15, 2020
77e3c8e
:new: #1806 开放平台增加第三方平台代公众号实现复用公众号资料快速创建小程序的接口
binarywang Oct 17, 2020
07bc5a5
:new: 微信开发平台模块增加OAuth2相关接口(网页授权、网页登录等)的实现
binarywang Oct 18, 2020
1510041
:art: 优化部分代码,明确出错信息
binarywang Oct 18, 2020
08bb399
:bookmark: 发布 3.9.5.B 测试版本
binarywang Oct 18, 2020
1849890
:new: #1817 企业微信增加批量获取外部联系人详情的接口,同时修复外部联系人中listGroupChat参数失效问题
Oct 23, 2020
449bda4
:art: 优化代码,实现序列化接口
binarywang Oct 23, 2020
15e02d7
:art: #1820 优化更新getTicket方法,调整锁调用时机避免并发问题
jnLaoA Oct 25, 2020
fc6428c
Merge branch 'master' into develop
binarywang Oct 25, 2020
c9d8509
Update CONTRIBUTING.md
binarywang Oct 25, 2020
3c7d470
:new: #1814 微信支付解析扫码支付回调通知增加签名类型的重载方法
binarywang Oct 25, 2020
4654f42
:bookmark: 发布 3.9.6.B 测试版本
binarywang Oct 25, 2020
8bd95bc
:art: 重构部分包结构
binarywang Oct 25, 2020
7eb11c8
:art: #1827 微信支付分相关接口优化
winter4666 Oct 29, 2020
73f30b1
:art: #1832 微信支付电商收付通增加查询提现状态的接口
f00lish Oct 31, 2020
7fdfe2c
:bug: #1824 微信支付修复分账回退接口结果错误码解析错误的问题
binarywang Oct 31, 2020
c584cd0
:art: #1834 微信会员卡基本信息类增加缺少字段 use_limit
binarywang Oct 31, 2020
aa26d6b
:bug: #1828 修复企业微信第三方应用消息路由相关方法参数错误的问题
binarywang Oct 31, 2020
e6a550d
:new: #1831 生成小程序二维码的相关接口增加指定文件路径参数的重载方法
gentryhuang Nov 1, 2020
7bca440
:bookmark: 发布 3.9.7.B 测试版本
binarywang Nov 1, 2020
f2b423b
:art: #1848 刷卡支付接口响应结果类增加服务商调用时的返回字段
Kidwind Nov 3, 2020
474ce2a
:art: 增加点注释
binarywang Nov 4, 2020
a3250c9
:art: #1849 企业微信外部联系人相关接口重构,优化重复代码,同时获取客户详情接口返回增加标签id字段
binarywang Nov 4, 2020
c235018
:art: Update javadoc for WxMaQrcodeService.java
zacksleo Nov 5, 2020
a2de4ac
:bug: #1852 修复个性化菜单clientPlatformType字段的反序列化问题
wcc1433 Nov 5, 2020
b693c5f
:art: 补充完善单元测试
binarywang Nov 5, 2020
9850151
:bug: #1856 【微信支付】修复电商收付通查询退款状态的接口地址
f00lish Nov 6, 2020
3b43911
:art: #1857 【企业微信】获取获取部门成员详情接口返回值增加第三方应用专有的open_userid字段
binarywang Nov 8, 2020
6037002
:bookmark: 发布 3.9.8.B 测试版本
binarywang Nov 8, 2020
bf4c8c2
:art: 修复out_trade_no 字段命名不规范问题
Pancratius Nov 10, 2020
e912587
:memo: add more cases
binarywang Nov 10, 2020
4af70b2
:bug: #1861【微信支付】支付分后付费项目请求类的amount属性改为Integer,允许为空
winter4666 Nov 10, 2020
f301912
:bug: #1864 【微信支付】WxPayConfig类的hashCode和equals方法移除 verifier 字段
xJoeWoo Nov 11, 2020
edc04cb
:new: #1863 【小程序】增加删除直播间、编辑直播间、获取直播间推流地址、获取直播间分享二维码等接口
lipengjun92 Nov 11, 2020
a2074a4
:art: #1867【企业微信】优化完善第三方应用的接入代码
xworks Nov 12, 2020
c605330
:new: #1869 【小程序】增加管理直播间小助手的相关接口
GaoMinzhu Nov 13, 2020
30aca49
:new: #1868 【微信支付】增加通用上传图片接口,支持传入流和文件名参数
f00lish Nov 13, 2020
6d556f8
:art: 优化代码,部分类增加序列化接口实现
binarywang Nov 14, 2020
5986698
:art: 增加点单元测试示例代码
binarywang Nov 15, 2020
384dd35
:bookmark: 发布 3.9.9.B 测试版本
binarywang Nov 15, 2020
940f69a
:arrow_up: 升级xstream版本
binarywang Nov 16, 2020
64d67bb
:arrow_up: Bump xstream
dependabot[bot] Nov 17, 2020
c80e77c
:new: #1873 【企业微信】第三方应用增加网页授权登陆获取访问用户身份和获取访问用户敏感信息的接口
huangxm129 Nov 17, 2020
b351ef7
:bug: 修复字段错误问题
binarywang Nov 17, 2020
1bac8f9
:bug: #1883【公众号】修复卡券导入code接口错误的返回类型
ly8388 Nov 21, 2020
57ab245
:art: 规范变量名
binarywang Nov 21, 2020
b4da5c9
:new: #1885 【微信支付】电商收付通增加资金账单下载的接口
f00lish Nov 24, 2020
e6a3e6e
:new: #1866 【小程序】 增加提审素材上传接口请求执行器
yangyh22 Nov 24, 2020
ff064c8
:art: 重构规范小程序部分代码包结构
binarywang Nov 24, 2020
c0af379
:art: #1888【企业微信】补充完善OA审批回调事件消息部分字段缺失的问题
Gyv12345 Nov 27, 2020
0e21866
:new: #1746: 【企业微信】第三方应用增加授权配置接口,同时增加向员工付款的接口
LeoInnovateLab Nov 29, 2020
b0440e0
:art: #1886 【小程序】创建直播间接口增加二维码地址字段
binarywang Nov 29, 2020
bf92d03
:bookmark: 发布 4.0.0 正式版本
binarywang Nov 29, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
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