Skip to content

Commit 0a31386

Browse files
authored
Merge branch 'binarywang:develop' into develop
2 parents 44cfeb3 + 7089548 commit 0a31386

485 files changed

Lines changed: 23655 additions & 1153 deletions

File tree

Some content is hidden

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

.github/agents/my-agent.agent.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ description: 需要用中文,包括PR标题和分析总结过程
1010

1111
# My Agent
1212

13-
请使用中文输出思考过程和总结,包括PR标题,提交commit信息也要使用中文
13+
- 1、请使用中文输出思考过程和总结,包括PR标题,提交commit信息也要使用中文;
14+
- 2、生成代码时需要提供必要的单元测试代码;
15+
- 3、新增加的代码如果标记作者信息,请注意不要把作者名设为binarywang或者其他无关人员,要改为 GitHub Copilot。

.github/workflows/maven-publish.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,22 @@ jobs:
3333
VERSION="${BASE_VER}.B"
3434
TAG="v${BASE_VER}"
3535
IS_RELEASE="true"
36-
echo "Matched release commit: VERSION=$VERSION, TAG=$TAG"
36+
echo "Matched test release commit: VERSION=$VERSION, TAG=$TAG"
37+
# 检查并打tag
38+
if git tag | grep -q "^$TAG$"; then
39+
echo "Tag $TAG already exists."
40+
else
41+
git config user.name "Binary Wang"
42+
git config user.email "a@binarywang.com"
43+
git tag -a "$TAG" -m "Release $TAG"
44+
git push origin "$TAG"
45+
echo "Tag $TAG created and pushed."
46+
fi
47+
elif [[ "$COMMIT_MSG" =~ ^:bookmark:\ 发布\ ([0-9]+\.[0-9]+\.[0-9]+)\ 正式版本 ]]; then
48+
VERSION="${BASH_REMATCH[1]}"
49+
TAG="v${VERSION}"
50+
IS_RELEASE="true"
51+
echo "Matched formal release commit: VERSION=$VERSION, TAG=$TAG"
3752
# 检查并打tag
3853
if git tag | grep -q "^$TAG$"; then
3954
echo "Tag $TAG already exists."

README.md

Lines changed: 77 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@
1818
</a>
1919
</div>
2020

21-
### 微信`Java`开发工具包,支持包括微信支付、开放平台、公众号、企业微信、视频号、小程序等微信功能模块的后端开发。
21+
### 微信 `Java` 开发工具包,支持包括微信支付、开放平台、公众号、企业微信、视频号、小程序等微信功能模块的后端开发。
22+
23+
### 特别赞助
2224
<div align="center">
23-
<b>特别赞助</b>
2425
<table cellspacing="0" cellpadding="0" width="500">
2526
<tr>
2627
<td align="center" colspan="3">
@@ -47,24 +48,52 @@
4748
<img height="120" src="https://gitee.com/binary/weixin-java-tools/raw/develop/images/qrcodes/mp.png" alt="mp qrcode">
4849
</a>
4950
</td>
50-
<td align="center">
51-
<a href="https://www.diboot.com?from=wxjava" target="_blank">
52-
<img height="120" src="https://www.diboot.com/img/diboot_ad.png" alt="diboot低代码开发平台">
53-
</a>
51+
<td align="center" style="font-size: 18px; font-weight: bold; vertical-align: middle;">
52+
赞助商招募中
5453
</td>
5554
<td align="center">
56-
<a href="https://www.crmeb.com/xiazai" target="_blank">
57-
<img height="120" src="https://crmebjavamer.oss-cn-beijing.aliyuncs.com/crmebimage/gitee/WechatIMG202.jpg" alt="ad">
55+
<a href="https://github.crmeb.net/u/wxjava" target="_blank">
56+
<img height="120" src="https://crmebjavamer.oss-cn-beijing.aliyuncs.com/crmebimage/image/2026/01/30/0a71b2b3535d42b187fff977c33faa30mh9gipgeja.png" alt="ad">
5857
</a>
5958
</td>
6059
</tr>
6160
</table>
6261
</div>
6362

63+
### 目录索引
64+
- [快速开始(3分钟)](#快速开始3分钟)
65+
- [我该选哪个模块?](#我该选哪个模块)
66+
- [Maven 引用方式](#maven-引用方式)
67+
- [最小示例](#最小示例)
68+
- [重要信息](#重要信息)
69+
- [其他说明](#其他说明)
70+
- [版本说明](#版本说明)
71+
- [应用案例](#应用案例)
72+
- [特别赞助](#特别赞助)
73+
- [贡献者列表](#贡献者列表)
74+
75+
### 快速开始(3分钟)
76+
1. 根据业务场景选择模块(见下方“我该选哪个模块?”)
77+
2. 引入 Maven 依赖并选择对应模块
78+
3. 参考最小示例完成初始化并调用 API
79+
80+
### 我该选哪个模块?
81+
82+
| 业务场景 | 模块 | artifactId |
83+
|---|---|---|
84+
| 微信公众号开发 | MP | `weixin-java-mp` |
85+
| 微信小程序开发 | MiniApp | `weixin-java-miniapp` |
86+
| 微信支付 | Pay | `weixin-java-pay` |
87+
| 企业微信 | CP | `weixin-java-cp` |
88+
| 微信开放平台(第三方平台) | Open | `weixin-java-open` |
89+
| 视频号 / 微信小店 | Channel | `weixin-java-channel` |
90+
91+
> 移动端(iOS/Android)微信登录、分享等能力仍需集成微信官方客户端 SDK;本项目为服务端 SDK。
92+
6493
### 重要信息
6594
1. [`WxJava` 荣获 `GitCode` 2024年度十大开源社区奖项](https://mp.weixin.qq.com/s/wM_UlMsDm3IZ1CPPDvcvQw)
6695
2. 项目合作洽谈请联系微信`binary0000`(在微信里自行搜索并添加好友,请注明来意,如有关于SDK问题需讨论请参考下文入群讨论,不要加此微信)。
67-
3. **2024-12-30 发布 [【4.7.0正式版】](https://mp.weixin.qq.com/s/_7k-XLYBqeJJhvHWCsdT0A)**
96+
3. **2026-01-03 发布 [【4.8.0正式版】](https://mp.weixin.qq.com/s/mJoFtGc25pXCn3uZRh6Q-w)**
6897
5. 贡献源码可以参考视频:[【贡献源码全过程(上集)】](https://mp.weixin.qq.com/s/3xUZSATWwHR_gZZm207h7Q)[【贡献源码全过程(下集)】](https://mp.weixin.qq.com/s/nyzJwVVoYSJ4hSbwyvTx9A) ,友情提供:[程序员小山与Bug](https://space.bilibili.com/473631007)
6998
6. 新手重要提示:本项目仅是一个SDK开发工具包,未提供Web实现,建议使用 `maven``gradle` 引用本项目即可使用本SDK提供的各种功能,详情可参考 **[【Demo项目】](demo.md)** 或本项目中的部分单元测试代码;
7099
7. 微信开发新手请务必阅读【开发文档】([Gitee Wiki](https://gitee.com/binary/weixin-java-tools/wikis/Home) 或者 [Github Wiki](https://github.com/binarywang/WxJava/wiki))的常见问题部分,可以少走很多弯路,节省不少时间。
@@ -95,7 +124,7 @@
95124
<dependency>
96125
<groupId>com.github.binarywang</groupId>
97126
<artifactId>(不同模块参考下文)</artifactId>
98-
<version>4.7.0</version>
127+
<version>4.8.0</version>
99128
</dependency>
100129
```
101130

@@ -114,6 +143,44 @@
114143
- **微信开放平台**`weixin-java-open`)主要用于第三方平台,代公众号或小程序进行开发和管理
115144

116145

146+
147+
---------------------------------
148+
### 最小示例
149+
150+
<details>
151+
<summary>公众号(MP)示例:获取 AccessToken</summary>
152+
153+
```java
154+
WxMpDefaultConfigImpl config = new WxMpDefaultConfigImpl();
155+
config.setAppId("your-app-id");
156+
config.setSecret("your-secret");
157+
158+
WxMpService wxMpService = new WxMpServiceImpl();
159+
wxMpService.setWxMpConfigStorage(config);
160+
161+
String accessToken = wxMpService.getAccessToken();
162+
System.out.println(accessToken);
163+
```
164+
165+
</details>
166+
167+
<details>
168+
<summary>小程序(MiniApp)示例:code2Session</summary>
169+
170+
```java
171+
WxMaDefaultConfigImpl config = new WxMaDefaultConfigImpl();
172+
config.setAppid("your-app-id");
173+
config.setSecret("your-secret");
174+
175+
WxMaService wxMaService = new WxMaServiceImpl();
176+
wxMaService.setWxMaConfig(config);
177+
178+
WxMaJscode2SessionResult result = wxMaService.getUserService().getSessionInfo("js-code");
179+
System.out.println(result.getOpenid());
180+
```
181+
182+
</details>
183+
117184
---------------------------------
118185
### 版本说明
119186

demo.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,11 @@
1414
- [使用该 `starter` 实现的小程序 `Demo`](https://github.com/binarywang/wx-java-miniapp-demo)
1515

1616
### Demo 列表
17-
1. 微信支付 Demo:[GitHub](http://github.com/binarywang/weixin-java-pay-demo)[码云](http://gitee.com/binary/weixin-java-pay-demo) [![Build Status](https://app.travis-ci.com/binarywang/weixin-java-pay-demo.svg?branch=master)](https://app.travis-ci.com/binarywang/weixin-java-pay-demo)
18-
1. 企业号/企业微信 Demo:[GitHub](http://github.com/binarywang/weixin-java-cp-demo)[码云](http://gitee.com/binary/weixin-java-cp-demo) [![Build Status](https://app.travis-ci.com/binarywang/weixin-java-cp-demo.svg?branch=master)](https://app.travis-ci.com/binarywang/weixin-java-cp-demo)
19-
1. 微信小程序 Demo:[GitHub](http://github.com/binarywang/weixin-java-miniapp-demo)[码云](http://gitee.com/binary/weixin-java-miniapp-demo) [![Build Status](https://app.travis-ci.com/binarywang/weixin-java-miniapp-demo.svg?branch=master)](https://app.travis-ci.com/binarywang/weixin-java-miniapp-demo)
20-
1. 开放平台 Demo:[GitHub](http://github.com/Wechat-Group/weixin-java-open-demo)[码云](http://gitee.com/binary/weixin-java-open-demo) [![Build Status](https://app.travis-ci.com/Wechat-Group/weixin-java-open-demo.svg?branch=master)](https://app.travis-ci.com/Wechat-Group/weixin-java-open-demo)
17+
1. 微信支付 Demo:[GitHub](http://github.com/binarywang/weixin-java-pay-demo)[码云](http://gitee.com/binary/weixin-java-pay-demo)
18+
1. 企业号/企业微信 Demo:[GitHub](http://github.com/binarywang/weixin-java-cp-demo)[码云](http://gitee.com/binary/weixin-java-cp-demo)
19+
1. 微信小程序 Demo:[GitHub](http://github.com/binarywang/weixin-java-miniapp-demo)[码云](http://gitee.com/binary/weixin-java-miniapp-demo)
20+
1. 开放平台 Demo:[GitHub](http://github.com/Wechat-Group/weixin-java-open-demo)[码云](http://gitee.com/binary/weixin-java-open-demo)
2121
1. 微信公众号 Demo:
22-
- 使用 `Spring MVC` 实现的公众号 Demo:[GitHub](http://github.com/binarywang/weixin-java-mp-demo-springmvc)、[码云](https://gitee.com/binary/weixin-java-mp-demo) [![Build Status](https://app.travis-ci.com/binarywang/weixin-java-mp-demo-springmvc.svg?branch=master)](https://app.travis-ci.com/binarywang/weixin-java-mp-demo-springmvc)
23-
- 使用 `Spring Boot` 实现的公众号 Demo(支持多公众号):[GitHub](http://github.com/binarywang/weixin-java-mp-demo)、[码云](http://gitee.com/binary/weixin-java-mp-demo-springboot) [![Build Status](https://app.travis-ci.com/binarywang/weixin-java-mp-demo.svg?branch=master)](https://app.travis-ci.com/binarywang/weixin-java-mp-demo)
24-
- 含公众号和部分微信支付代码的 Demo:[GitHub](http://github.com/Wechat-Group/weixin-java-demo-springmvc)、[码云](http://gitee.com/binary/weixin-java-tools-springmvc) [![Build Status](https://app.travis-ci.com/Wechat-Group/weixin-java-demo-springmvc.svg?branch=master)](https://app.travis-ci.com/Wechat-Group/weixin-java-demo-springmvc)
25-
22+
- 使用 `Spring MVC` 实现的公众号 Demo:[GitHub](http://github.com/binarywang/weixin-java-mp-demo-springmvc)、[码云](https://gitee.com/binary/weixin-java-mp-demo)
23+
- 使用 `Spring Boot` 实现的公众号 Demo(支持多公众号):[GitHub](http://github.com/binarywang/weixin-java-mp-demo)、[码云](http://gitee.com/binary/weixin-java-mp-demo-springboot)
24+
- 含公众号和部分微信支付代码的 Demo:[GitHub](http://github.com/Wechat-Group/weixin-java-demo-springmvc)、[码云](http://gitee.com/binary/weixin-java-tools-springmvc)

0 commit comments

Comments
 (0)