Skip to content

Commit 6ff8774

Browse files
authored
Merge branch 'binarywang:develop' into develop
2 parents 39a2702 + 47051bd commit 6ff8774

File tree

331 files changed

+1471
-847
lines changed

Some content is hidden

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

331 files changed

+1471
-847
lines changed

.github/workflows

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Publish to Maven Central
2+
on:
3+
push:
4+
branches:
5+
- develop
6+
7+
jobs:
8+
build-and-publish:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
# 检出代码
13+
- name: Checkout Code
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
18+
# 设置所需的Java版本
19+
- name: Set up Java
20+
uses: actions/setup-java@v4
21+
with:
22+
java-version: '8'
23+
distribution: 'temurin'
24+
server-id: central
25+
server-username: MAVEN_USERNAME
26+
server-password: MAVEN_PASSWORD
27+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
28+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
29+
cache: maven
30+
31+
- name: Verify GPG keys
32+
run: |
33+
echo "Available GPG Keys:"
34+
gpg --list-secret-keys --keyid-format LONG
35+
36+
- name: Generate version && Set version
37+
id: set_version
38+
run: |
39+
git describe --tags 2>/dev/null || echo "no tag"
40+
TIMESTAMP=$(date +'%Y%m%d.%H%M%S')
41+
GIT_DESCRIBE=$(git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//' || echo "0.0.1")
42+
VERSION="${GIT_DESCRIBE}-${TIMESTAMP}"
43+
echo "Generated version: $VERSION"
44+
mvn versions:set -DnewVersion=$VERSION --no-transfer-progress
45+
env:
46+
TZ: Asia/Shanghai
47+
48+
- name: Publish to Maven Central
49+
run: |
50+
mvn clean deploy -P release \
51+
-Dmaven.test.skip=true \
52+
-Dgpg.args="--batch --yes --pinentry-mode loopback" \
53+
--no-transfer-progress
54+
env:
55+
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
56+
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
57+
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

README.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
## WxJava - 微信开发 Java SDK
22

33
[![码云Gitee](https://gitee.com/binary/weixin-java-tools/badge/star.svg?theme=blue)](https://gitee.com/binary/weixin-java-tools)
4-
[![Github](https://img.shields.io/github/stars/binarywang/WxJava?logo=github&style=flat)](https://github.com/binarywang/WxJava)
5-
[![GitHub release](https://img.shields.io/github/release/binarywang/WxJava.svg)](https://github.com/binarywang/WxJava/releases)
6-
[![Maven Central](https://img.shields.io/maven-central/v/com.github.binarywang/wx-java.svg)](http://mvnrepository.com/artifact/com.github.binarywang/wx-java)
7-
[![Build Status](https://img.shields.io/circleci/project/github/binarywang/WxJava/develop.svg?sanitize=true)](https://circleci.com/gh/binarywang/WxJava/tree/develop)
4+
[![Github](https://img.shields.io/github/stars/binarywang/WxJava?logo=github&style=flat&label=Stars)](https://github.com/binarywang/WxJava)
5+
[![GitHub release](https://img.shields.io/github/release/binarywang/WxJava?label=Release)](https://github.com/binarywang/WxJava/releases)
6+
[![Maven Central](https://img.shields.io/maven-central/v/com.github.binarywang/wx-java?label=Maven)](http://mvnrepository.com/artifact/com.github.binarywang/wx-java)
7+
[![Build Status](https://img.shields.io/circleci/project/github/binarywang/WxJava/develop.svg?sanitize=true&label=Build)](https://circleci.com/gh/binarywang/WxJava/tree/develop)
88
[![使用IntelliJ IDEA开发维护](https://img.shields.io/badge/IntelliJ%20IDEA-支持-blue.svg)](https://www.jetbrains.com/?from=WxJava-weixin-java-tools)
99
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
1010

@@ -113,10 +113,13 @@
113113
<details>
114114
<summary>点此展开查看</summary>
115115

116-
1. 本项目定为大约每两个月发布一次正式版(同时 `develop` 分支代码合并进入 `release` 分支),版本号格式为 `X.X.0`(如`2.1.0``2.2.0`等),遇到重大问题需修复会及时提交新版本,欢迎大家随时提交Pull Request;
117-
2. BUG修复和新特性一般会先发布成小版本作为临时测试版本(如`3.6.8.B`,即尾号不为0,并添加B,以区别于正式版),代码仅存在于 `develop` 分支中;
118-
3. 目前最新版本号为 [![Maven Central](https://img.shields.io/maven-central/v/com.github.binarywang/wx-java.svg)](http://mvnrepository.com/artifact/com.github.binarywang/wx-java) ,也可以通过访问链接 [【微信支付】](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.github.binarywang%22%20AND%20a%3A%22weixin-java-pay%22)[【微信小程序】](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.github.binarywang%22%20AND%20a%3A%22weixin-java-miniapp%22)[【公众号】](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.github.binarywang%22%20AND%20a%3A%22weixin-java-mp%22)[【企业微信】](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.github.binarywang%22%20AND%20a%3A%22weixin-java-cp%22)[【开放平台】](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.github.binarywang%22%20AND%20a%3A%22weixin-java-open%22)
119-
分别查看所有最新的版本。
116+
1. 本项目定为大约每半年左右发布一次正式版,遇到重大问题需修复会及时提交新版本,欢迎大家随时提交 `Pull Request`
117+
2. 每次代码更新都会自动构建出新版本方便及时尝鲜,版本号格式为 `x.x.x-时间戳`;
118+
3. 发布正式版时,`develop` 分支代码合并进入 `release` 分支),版本号格式为 `X.X.0`(如`2.1.0``2.2.0`等);
119+
4. 每隔一段时间后,会发布测试版本(如`3.6.8.B`,即尾号不为0,并添加B,以区别于正式版),代码仅存在于 `develop` 分支中;
120+
5. 目前最新版本号为 [![Maven Central](https://img.shields.io/maven-central/v/com.github.binarywang/wx-java.svg)](http://mvnrepository.com/artifact/com.github.binarywang/wx-java) ,也可以通过访问以下链接分别查看各个模块最新的版本:
121+
[【微信支付】](https://central.sonatype.com/artifact/com.github.binarywang/weixin-java-pay/versions)[【小程序】](https://central.sonatype.com/artifact/com.github.binarywang/weixin-java-miniapp/versions)[【公众号】](https://central.sonatype.com/artifact/com.github.binarywang/weixin-java-mp/versions)[【企业微信】](https://central.sonatype.com/artifact/com.github.binarywang/weixin-java-cp/versions)[【开放平台】](https://central.sonatype.com/artifact/com.github.binarywang/weixin-java-open/versions)[【视频号】](https://central.sonatype.com/artifact/com.github.binarywang/weixin-java-channel/versions)
122+
120123

121124
</details>
122125

pom.xml

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>com.github.binarywang</groupId>
55
<artifactId>wx-java</artifactId>
6-
<version>4.7.4.B</version>
6+
<version>4.7.5.B</version>
77
<packaging>pom</packaging>
88
<name>WxJava - Weixin/Wechat Java SDK</name>
99
<description>微信开发Java SDK</description>
@@ -136,10 +136,8 @@
136136

137137
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
138138
<httpclient.version>4.5.13</httpclient.version>
139-
<jetty.version>9.4.56.v20240826</jetty.version>
140-
<!-- 这个不能用10以上的版本,不支持jdk8-->
139+
<jetty.version>9.4.57.v20241219</jetty.version> <!-- 这个不能用10以上的版本,不支持jdk8-->
141140
</properties>
142-
143141
<dependencyManagement>
144142
<dependencies>
145143
<dependency>
@@ -198,17 +196,19 @@
198196
<dependency>
199197
<groupId>com.google.guava</groupId>
200198
<artifactId>guava</artifactId>
201-
<version>32.1.2-jre</version>
199+
<version>33.3.1-jre</version>
202200
</dependency>
203201
<dependency>
204202
<groupId>com.google.code.gson</groupId>
205203
<artifactId>gson</artifactId>
206-
<version>2.10.1</version>
204+
<version>2.13.1</version>
207205
</dependency>
208206
<dependency>
209-
<groupId>com.fasterxml.jackson.dataformat</groupId>
210-
<artifactId>jackson-dataformat-xml</artifactId>
211-
<version>2.15.2</version>
207+
<groupId>com.fasterxml.jackson</groupId>
208+
<artifactId>jackson-bom</artifactId>
209+
<version>2.18.1</version>
210+
<type>pom</type>
211+
<scope>import</scope>
212212
</dependency>
213213

214214
<!-- 测试所用依赖 -->
@@ -332,17 +332,6 @@
332332
</dependencies>
333333
</dependencyManagement>
334334

335-
<distributionManagement>
336-
<snapshotRepository>
337-
<id>ossrh</id>
338-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
339-
</snapshotRepository>
340-
<repository>
341-
<id>ossrh</id>
342-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
343-
</repository>
344-
</distributionManagement>
345-
346335
<profiles>
347336
<profile>
348337
<id>doclint-java8-disable</id>
@@ -432,14 +421,14 @@
432421

433422
<plugins>
434423
<plugin>
435-
<groupId>org.sonatype.plugins</groupId>
436-
<artifactId>nexus-staging-maven-plugin</artifactId>
437-
<version>1.6.3</version>
424+
<groupId>org.sonatype.central</groupId>
425+
<artifactId>central-publishing-maven-plugin</artifactId>
426+
<version>0.7.0</version>
438427
<extensions>true</extensions>
439428
<configuration>
440-
<serverId>ossrh</serverId>
441-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
442-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
429+
<deploymentName>Release WxJava:${project.version}</deploymentName>
430+
<publishingServerId>central</publishingServerId>
431+
<autoPublish>true</autoPublish>
443432
</configuration>
444433
</plugin>
445434
<plugin>

solon-plugins/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
<parent>
77
<groupId>com.github.binarywang</groupId>
88
<artifactId>wx-java</artifactId>
9-
<version>4.7.4.B</version>
9+
<version>4.7.5.B</version>
1010
</parent>
1111
<packaging>pom</packaging>
1212
<artifactId>wx-java-solon-plugins</artifactId>
1313
<name>WxJava - Solon Plugins</name>
1414
<description>WxJava 各个模块的 Solon Plugin</description>
1515

1616
<properties>
17-
<solon.version>3.0.1</solon.version>
17+
<solon.version>3.2.0</solon.version>
1818
</properties>
1919

2020
<modules>

solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>wx-java-solon-plugins</artifactId>
77
<groupId>com.github.binarywang</groupId>
8-
<version>4.7.4.B</version>
8+
<version>4.7.5.B</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# wx-java-channel-solon-plugin
2+
3+
## 快速开始
4+
1. 引入依赖
5+
```xml
6+
<dependencies>
7+
<dependency>
8+
<groupId>com.github.binarywang</groupId>
9+
<artifactId>wx-java-channel-solon-plugin</artifactId>
10+
<version>${version}</version>
11+
</dependency>
12+
13+
<!-- 配置存储方式为jedis 则引入jedis -->
14+
<dependency>
15+
<groupId>redis.clients</groupId>
16+
<artifactId>jedis</artifactId>
17+
<version>${jedis.version}</version>
18+
</dependency>
19+
20+
<!-- 配置存储方式为redisson 则引入redisson -->
21+
<dependency>
22+
<groupId>org.redisson</groupId>
23+
<artifactId>redisson</artifactId>
24+
<version>${redisson.version}</version>
25+
</dependency>
26+
</dependencies>
27+
```
28+
2. 添加配置(app.properties)
29+
```properties
30+
# 视频号配置(必填)
31+
## 视频号小店的appId和secret
32+
wx.channel.app-id=@appId
33+
wx.channel.secret=@secret
34+
# 视频号配置 选填
35+
## 设置视频号小店消息服务器配置的token
36+
wx.channel.token=@token
37+
## 设置视频号小店消息服务器配置的EncodingAESKey
38+
wx.channel.aes-key=
39+
## 支持JSON或者XML格式,默认JSON
40+
wx.channel.msg-data-format=JSON
41+
## 是否使用稳定版 Access Token
42+
wx.channel.use-stable-access-token=false
43+
44+
45+
# ConfigStorage 配置(选填)
46+
## 配置类型: memory(默认), jedis, redisson, redis_template
47+
wx.channel.config-storage.type=memory
48+
## 相关redis前缀配置: wx:channel(默认)
49+
wx.channel.config-storage.key-prefix=wx:channel
50+
wx.channel.config-storage.redis.host=127.0.0.1
51+
wx.channel.config-storage.redis.port=6379
52+
wx.channel.config-storage.redis.password=123456
53+
54+
55+
# http 客户端配置(选填)
56+
## # http客户端类型: http_client(默认)
57+
wx.channel.config-storage.http-client-type=http_client
58+
wx.channel.config-storage.http-proxy-host=
59+
wx.channel.config-storage.http-proxy-port=
60+
wx.channel.config-storage.http-proxy-username=
61+
wx.channel.config-storage.http-proxy-password=
62+
## 最大重试次数,默认:5 次,如果小于 0,则为 0
63+
wx.channel.config-storage.max-retry-times=5
64+
## 重试时间间隔步进,默认:1000 毫秒,如果小于 0,则为 1000
65+
wx.channel.config-storage.retry-sleep-millis=1000
66+
```
67+
3. 自动注入的类型
68+
- `WxChannelService`
69+
- `WxChannelConfig`
70+
4. 使用样例
71+
72+
```java
73+
import me.chanjar.weixin.channel.api.WxChannelService;
74+
import me.chanjar.weixin.channel.bean.shop.ShopInfoResponse;
75+
import me.chanjar.weixin.channel.util.JsonUtils;
76+
import me.chanjar.weixin.common.error.WxErrorException;
77+
import org.noear.solon.annotation.Inject;
78+
79+
@Component
80+
public class DemoService {
81+
@Inject
82+
private WxChannelService wxChannelService;
83+
84+
public String getShopInfo() throws WxErrorException {
85+
// 获取店铺基本信息
86+
ShopInfoResponse response = wxChannelService.getBasicService().getShopInfo();
87+
// 此处为演示,如果要返回response的结果,建议自己封装一个VO,避免直接返回response
88+
return JsonUtils.encode(response);
89+
}
90+
}
91+
```
92+

solon-plugins/wx-java-channel-solon-plugin/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<parent>
44
<artifactId>wx-java-solon-plugins</artifactId>
55
<groupId>com.github.binarywang</groupId>
6-
<version>4.7.4.B</version>
6+
<version>4.7.5.B</version>
77
</parent>
88
<modelVersion>4.0.0</modelVersion>
99

solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<artifactId>wx-java-solon-plugins</artifactId>
66
<groupId>com.github.binarywang</groupId>
7-
<version>4.7.4.B</version>
7+
<version>4.7.5.B</version>
88
</parent>
99
<modelVersion>4.0.0</modelVersion>
1010

solon-plugins/wx-java-cp-solon-plugin/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<artifactId>wx-java-solon-plugins</artifactId>
66
<groupId>com.github.binarywang</groupId>
7-
<version>4.7.4.B</version>
7+
<version>4.7.5.B</version>
88
</parent>
99
<modelVersion>4.0.0</modelVersion>
1010

0 commit comments

Comments
 (0)