Skip to content

Commit 0f8b10f

Browse files
committed
Merge remote-tracking branch 'Wechat-Group/master'
2 parents 5b0b32a + 812190a commit 0f8b10f

File tree

369 files changed

+14068
-5085
lines changed

Some content is hidden

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

369 files changed

+14068
-5085
lines changed

.codeclimate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ engines:
44
ratings:
55
paths: []
66
exclude_paths:
7-
- "README.md"
7+
- "readme.md"

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ language: java
22
sudo: false
33
install: true
44
addons:
5-
sonarqube:
5+
sonarcloud:
66
token:
77
secure: "834110c7191f97ecb226970c46dcaff8e681da5a"
88

alipay_qrcode.jpg

54.8 KB
Loading

contribution.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# 代码贡献指南
2-
1. 非常欢迎和感谢对本项目发起Pull Request的同学,本项目代码风格为使用2个空格代表一个Tab,因此在提交代码时请注意一下,否则很容易在IDE格式化代码后与原代码产生大量diff,这样会给其他人阅读代码带来极大的困扰。为了便于设置,本项目引入editorconfig插件,请使用eclipse的同学在贡献代码前安装相关插件,IntelliJ IDEA新版本自带支持,如果没有可自行安装插件。
2+
1. 首先非常欢迎和感谢对本项目发起Pull Request的同学。
3+
1. 本项目代码风格为使用2个空格代表一个Tab,因此在提交代码时请注意一下,否则很容易在IDE格式化代码后与原代码产生大量diff,这样会给其他人阅读代码带来极大的困扰。
4+
1. 为了便于设置,本项目引入editorconfig支持,请使用Eclipse的同学在贡献代码前安装相关插件,而IntelliJ IDEA新版本自带支持,如果没有可自行安装插件。
5+
1. **提交代码前,请检查代码是否已经格式化,并且保证新增加或者修改的方法都有完整的参数说明,而public方法必须拥有相应的单元测试并通过测试。**
36
1. 本项目可以采用两种方式接受代码贡献:
4-
* 第一种就是基于[Git Flow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow)开发流程,因此在发起Pull Request的时候请选择develop分支,详细步骤参考后文,推荐使用此种方式贡献代码。
5-
****暂停此种方式,请使用第一种***)另外一种贡献代码的方式就是加入SDK Developers开发组,前提是对自己的代码足够自信就可以申请加入,加入之后可以随时直接提交代码,但要注意对所做的修改或新增的代码进行单元测试,保证提交代码没有明显问题。
6-
1. 另外,提交代码前请检查代码是否已经格式化,并且保证新增加或者修改的方法都有完整的参数说明,而public方法必须拥有相应的单元测试并通过测试。
7-
7+
- 第一种就是基于[Git Flow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow)开发流程,因此在发起Pull Request的时候请选择develop分支,详细步骤参考后文,推荐使用此种方式贡献代码。
8+
-***暂停此种方式,请使用第一种***)另外一种贡献代码的方式就是加入SDK Developers开发组,前提是对自己的代码足够自信就可以申请加入,加入之后可以随时直接提交代码,但要注意对所做的修改或新增的代码进行单元测试,保证提交代码没有明显问题。
89

910
### PR方式贡献代码步骤
1011
* 在 GitHub 上 `fork` 到自己的仓库,如 `my_user/weixin-java-tools`,然后 `clone` 到本地,并设置用户信息。

pom.xml

Lines changed: 91 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<?xml version="1.0"?>
22
<project
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
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">
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
5+
xmlns="http://maven.apache.org/POM/4.0.0">
56
<modelVersion>4.0.0</modelVersion>
67
<groupId>com.github.binarywang</groupId>
78
<artifactId>weixin-java-parent</artifactId>
8-
<version>2.6.0</version>
9+
<version>2.7.0</version>
910
<packaging>pom</packaging>
1011
<name>WeiXin Java Tools - Parent</name>
1112
<description>微信公众号、企业号上级POM</description>
@@ -74,6 +75,11 @@
7475
<email>[email protected]</email>
7576
<url>https://github.com/aimilin6688</url>
7677
</developer>
78+
<developer>
79+
<name>ecoolper</name>
80+
<email>[email protected]</email>
81+
<url>https://github.com/crskyp</url>
82+
</developer>
7783
</developers>
7884

7985
<scm>
@@ -87,6 +93,7 @@
8793
<module>weixin-java-cp</module>
8894
<module>weixin-java-mp</module>
8995
<module>weixin-java-pay</module>
96+
<module>weixin-java-miniapp</module>
9097
<!--module>weixin-java-osgi</module-->
9198
</modules>
9299

@@ -98,73 +105,90 @@
98105
<downloadJavadocs>true</downloadJavadocs>
99106
<downloadSources>true</downloadSources>
100107
<httpclient.version>4.5</httpclient.version>
101-
<slf4j.version>1.7.10</slf4j.version>
102-
<logback.version>1.1.2</logback.version>
103-
<gson.version>2.7</gson.version>
104-
<guava.version>19.0</guava.version>
105-
<commons-lang3.version>3.5</commons-lang3.version>
106-
<commons-io.version>2.5</commons-io.version>
107-
<commons-codec.version>1.10</commons-codec.version>
108108
<jetty.version>9.3.0.RC0</jetty.version>
109-
<jedis.version>2.9.0</jedis.version>
110109
</properties>
111110

112-
<dependencies>
113-
<dependency>
114-
<groupId>org.slf4j</groupId>
115-
<artifactId>slf4j-api</artifactId>
116-
<version>${slf4j.version}</version>
117-
</dependency>
118-
<dependency>
119-
<groupId>com.thoughtworks.xstream</groupId>
120-
<artifactId>xstream</artifactId>
121-
<version>1.4.9</version>
122-
</dependency>
123-
<dependency>
124-
<groupId>ch.qos.logback</groupId>
125-
<artifactId>logback-classic</artifactId>
126-
<version>${logback.version}</version>
127-
<scope>test</scope>
128-
</dependency>
129-
<dependency>
130-
<groupId>org.apache.httpcomponents</groupId>
131-
<artifactId>httpclient</artifactId>
132-
<version>${httpclient.version}</version>
133-
</dependency>
134-
<dependency>
135-
<groupId>org.apache.httpcomponents</groupId>
136-
<artifactId>httpmime</artifactId>
137-
<version>${httpclient.version}</version>
138-
</dependency>
139-
<dependency>
140-
<groupId>com.google.code.gson</groupId>
141-
<artifactId>gson</artifactId>
142-
<version>${gson.version}</version>
143-
</dependency>
144-
<dependency>
145-
<groupId>commons-codec</groupId>
146-
<artifactId>commons-codec</artifactId>
147-
<version>${commons-codec.version}</version>
148-
</dependency>
149-
<dependency>
150-
<groupId>commons-io</groupId>
151-
<artifactId>commons-io</artifactId>
152-
<version>${commons-io.version}</version>
153-
</dependency>
154-
<dependency>
155-
<groupId>org.apache.commons</groupId>
156-
<artifactId>commons-lang3</artifactId>
157-
<version>${commons-lang3.version}</version>
158-
</dependency>
159-
<dependency>
160-
<groupId>com.google.guava</groupId>
161-
<artifactId>guava</artifactId>
162-
<version>${guava.version}</version>
163-
</dependency>
164-
</dependencies>
165-
166111
<dependencyManagement>
167112
<dependencies>
113+
<dependency>
114+
<groupId>com.github.binarywang</groupId>
115+
<artifactId>qrcode-utils</artifactId>
116+
<version>1.1</version>
117+
</dependency>
118+
<!-- 由于jodd-http较新的3.8版本需要jdk8,故而此处采用较低版本 -->
119+
<dependency>
120+
<groupId>org.jodd</groupId>
121+
<artifactId>jodd-http</artifactId>
122+
<version>3.7.1</version>
123+
<scope>provided</scope>
124+
</dependency>
125+
<dependency>
126+
<groupId>com.squareup.okhttp3</groupId>
127+
<artifactId>okhttp</artifactId>
128+
<version>3.7.0</version>
129+
<scope>provided</scope>
130+
</dependency>
131+
132+
<dependency>
133+
<groupId>org.apache.httpcomponents</groupId>
134+
<artifactId>httpclient</artifactId>
135+
<version>${httpclient.version}</version>
136+
</dependency>
137+
<dependency>
138+
<groupId>org.apache.httpcomponents</groupId>
139+
<artifactId>httpmime</artifactId>
140+
<version>${httpclient.version}</version>
141+
</dependency>
142+
<dependency>
143+
<groupId>commons-codec</groupId>
144+
<artifactId>commons-codec</artifactId>
145+
<version>1.10</version>
146+
</dependency>
147+
<dependency>
148+
<groupId>commons-io</groupId>
149+
<artifactId>commons-io</artifactId>
150+
<version>2.5</version>
151+
</dependency>
152+
<dependency>
153+
<groupId>org.apache.commons</groupId>
154+
<artifactId>commons-lang3</artifactId>
155+
<version>3.5</version>
156+
</dependency>
157+
<dependency>
158+
<groupId>org.slf4j</groupId>
159+
<artifactId>slf4j-api</artifactId>
160+
<version>1.7.24</version>
161+
</dependency>
162+
<dependency>
163+
<groupId>com.thoughtworks.xstream</groupId>
164+
<artifactId>xstream</artifactId>
165+
<version>1.4.9</version>
166+
</dependency>
167+
<!-- 由于guava较新的21.0版本需要jdk8,故而此处采用较低版本 -->
168+
<dependency>
169+
<groupId>com.google.guava</groupId>
170+
<artifactId>guava</artifactId>
171+
<version>20.0</version>
172+
</dependency>
173+
<dependency>
174+
<groupId>com.google.code.gson</groupId>
175+
<artifactId>gson</artifactId>
176+
<version>2.8.0</version>
177+
</dependency>
178+
179+
<!-- 测试所用依赖 -->
180+
<dependency>
181+
<groupId>joda-time</groupId>
182+
<artifactId>joda-time</artifactId>
183+
<version>2.9.7</version>
184+
<scope>test</scope>
185+
</dependency>
186+
<dependency>
187+
<groupId>ch.qos.logback</groupId>
188+
<artifactId>logback-classic</artifactId>
189+
<version>1.1.11</version>
190+
<scope>test</scope>
191+
</dependency>
168192
<dependency>
169193
<groupId>com.google.inject</groupId>
170194
<artifactId>guice</artifactId>
@@ -174,7 +198,7 @@
174198
<dependency>
175199
<groupId>org.testng</groupId>
176200
<artifactId>testng</artifactId>
177-
<version>6.8.7</version>
201+
<version>6.10</version>
178202
<scope>test</scope>
179203
</dependency>
180204
<dependency>
@@ -198,7 +222,8 @@
198222
<dependency>
199223
<groupId>redis.clients</groupId>
200224
<artifactId>jedis</artifactId>
201-
<version>${jedis.version}</version>
225+
<version>2.9.0</version>
226+
<scope>provided</scope>
202227
</dependency>
203228
</dependencies>
204229
</dependencyManagement>

readme.md

Lines changed: 35 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,33 @@
1-
微信支付、公众号&企业号开发Java SDK
1+
微信支付、小程序、公众号&企业号开发Java SDK
22
---------------------------------
33
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.binarywang/weixin-java-parent/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.binarywang/weixin-java-parent)
44
[![Build Status](https://travis-ci.org/Wechat-Group/weixin-java-tools.svg?branch=develop)](https://travis-ci.org/Wechat-Group/weixin-java-tools)
55

6-
### 注意事项:
7-
1. 声明: ***本项目Fork自chanjarster/weixin-java-tools,但由于原项目已停止维护,故单独维护和发布,且发布到maven上的groupId也会不同,详细信息见下文。***
8-
1. **新手请注意,本项目仅是一个开发工具包(即SDK),未提供Web实现,建议使用maven或gradle引用本项目即可使用本SDK提供的各种功能,详情可参考下文中提到的Demo项目或本项目中的部分单元测试代码;如果没有贡献代码的意愿,不建议下载项目的源码自行编译,因为如果想看源码使用maven也是可以下载源码的**
9-
1. 最新更新:**2017-4-13 发布[【2.6.0正式版】](https://github.com/Wechat-Group/weixin-java-tools/releases)**
6+
#### 声明: ***本项目Fork自chanjarster/weixin-java-tools,但由于原项目已停止维护,故单独维护和发布,且发布到maven上的groupId也会不同,详细信息见下文。***
7+
8+
***新人提示:本项目仅是一个开发工具包(即SDK),未提供Web实现,建议使用maven或gradle引用本项目即可使用本SDK提供的各种功能,详情可参考下文中提到的Demo项目或本项目中的部分单元测试代码;另外微信开发新手请务必阅读wiki首页的常见问题部分,可以少走很多弯路,节省不少时间。***
9+
10+
## Demo项目列表
11+
* https://github.com/wechat-group/weixin-java-miniapp-demo (微信小程序Demo)
12+
* https://github.com/wechat-group/weixin-java-pay-demo (微信支付Demo)
13+
* https://github.com/wechat-group/weixin-java-cp-demo (企业号Demo)
14+
* https://github.com/wechat-group/weixin-java-mp-demo (公众号Demo,使用Spring MVC实现)
15+
* https://github.com/wechat-group/weixin-java-mp-demo-springboot (公众号Demo,使用Spring Boot实现)
16+
* https://github.com/wechat-group/weixin-java-tools-springmvc (公众号Demo,内含部分微信支付代码)
17+
* https://github.com/wechat-group/weixin-java-mp-multi-demo (支持多公众号)
18+
19+
---------------------------------
20+
### 其他信息:
21+
1. 最新更新:**2017-6-25 发布[【2.7.0正式版】](https://github.com/Wechat-Group/weixin-java-tools/releases)**
1022
1. 开源中国网站的本项目介绍的首页链接地址:https://www.oschina.net/p/weixin-java-tools-new
11-
1. 自2.0.0版本以来,公众号的接口调整比较大,主要是为了解决主接口类过于庞大不方便管理的问题,将接口实现代码按模块进行拆分。
1223
1. 自2.6.0版本开始,微信支付相关功能抽出独立为一个模块,详细使用方式请参考相关demo;
13-
1. SDK详细开发文档请查阅 [【Wiki】](https://github.com/wechat-group/weixin-java-tools/wiki),部分文档可能未能及时更新,如有发现,可以及时上报或者自行修改。***另外微信开发新手请务必阅读wiki首页的常见问题部分,可以少走很多弯路,节省不少时间。***
14-
1. 各个模块的Javadoc可以在线查看(有可能是最新的测试版本的,请注意观察版本号):[weixin-java-pay](https://binarywang.github.io/weixin-java-pay-javadoc/)[weixin-java-mp](https://binarywang.github.io/weixin-java-mp-javadoc/)[weixin-java-common](https://binarywang.github.io/weixin-java-common-javadoc/)[weixin-java-cp](https://binarywang.github.io/weixin-java-cp-javadoc/)
24+
1. 自2.7.0版本开始,支持微信小程序,具体可以参考相关demo;
25+
1. SDK详细开发文档请查阅 [【Wiki】](https://github.com/wechat-group/weixin-java-tools/wiki),部分文档可能未能及时更新,如有发现,可以及时上报或者自行修改。
26+
1. 各个模块的Javadoc可以在线查看(有可能是最新的测试版本的,请注意观察版本号):[weixin-java-miniapp](https://binarywang.github.io/weixin-java-miniapp-javadoc/)[weixin-java-pay](https://binarywang.github.io/weixin-java-pay-javadoc/)[weixin-java-mp](https://binarywang.github.io/weixin-java-mp-javadoc/)[weixin-java-common](https://binarywang.github.io/weixin-java-common-javadoc/)[weixin-java-cp](https://binarywang.github.io/weixin-java-cp-javadoc/)
1527
1. 本SDK要求的最低JDK版本是7,还在使用JDK6的用户请参考[【此项目】]( https://github.com/binarywang/weixin-java-tools-for-jdk6) ,而其他更早的JDK版本则需要自己改造实现。
1628
1. 如有新功能需求,发现BUG,或者由于微信官方接口调整导致的代码问题,可以直接在[【Issues】](https://github.com/Wechat-Group/weixin-java-tools/issues)页提出issue,便于讨论追踪问题;
1729
1. 如果想贡献代码,请阅读[【代码贡献指南】](contribution.md)
18-
1. 捐助渠道已开通,如有意向请前往托管于码云的项目首页(具体地址见下文)的页面评论区上方,可以找到“捐助”按钮非常感谢各位捐助的同学!
30+
1. **捐助渠道已开通,如有意向请点击[【支付宝二维码】](alipay_qrcode.jpg)捐赠,或者直接前往[【托管于码云的项目首页】](http://git.oschina.net/binary/weixin-java-tools),在评论区上方可以找到“捐助”按钮非常感谢各位捐助的同学!**
1931

2032
---------------------------------
2133
## SDK使用交流方式说明:
@@ -29,7 +41,7 @@
2941
## 版本说明
3042
1. 本项目定为大约每两个月发布一次正式版,版本号格式为X.X.0(如2.1.0,2.2.0等),遇到重大问题需修复会及时提交新版本,欢迎大家随时提交Pull Request;
3143
1. BUG修复和新特性一般会先发布成小版本作为临时测试版本(如2.4.5.BETA,2.4.6.BETA等,即尾号不为0,并添加BETA字样,以区别于正式版);
32-
1. 目前最新版本号为 [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.binarywang/weixin-java-parent/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.binarywang/weixin-java-parent) ,也可以通过访问链接 [【微信支付】](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-mp%22)[【企业号】](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.github.binarywang%22%20AND%20a%3A%22weixin-java-cp%22)
44+
1. 目前最新版本号为 [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.binarywang/weixin-java-parent/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.binarywang/weixin-java-parent) ,也可以通过访问链接 [【微信支付】](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)
3345
分别查看所有最新的版本。
3446

3547
---------------------------------
@@ -39,26 +51,26 @@
3951
* Bitbucket:https://bitbucket.org/binarywang/weixin-java-tools
4052
* Coding: https://git.coding.net/binarywang/weixin-java-tools.git
4153

42-
---------------------------------
43-
## 可参考的Demo项目
44-
#### 欢迎提供更多的Demo供新手参考:
45-
* https://github.com/wechat-group/weixin-java-mp-demo (公众号Demo,使用Spring MVC实现)
46-
* https://github.com/wechat-group/weixin-java-mp-demo-springboot (公众号Demo,使用Spring Boot实现)
47-
* https://github.com/wechat-group/weixin-java-tools-springmvc (公众号Demo,内含部分微信支付代码)
48-
* https://github.com/wechat-group/weixin-java-mp-multi-demo (支持多公众号)
49-
* https://github.com/wechat-group/weixin-java-pay-demo (微信支付demo)
50-
* https://github.com/wechat-group/weixin-java-cp-demo (企业号demo,筹备中)
51-
5254
---------------------------------
5355
## Maven 最新正式版本
5456

57+
* 微信小程序:
58+
59+
```xml
60+
<dependency>
61+
<groupId>com.github.binarywang</groupId>
62+
 <artifactId>weixin-java-miniapp</artifactId>
63+
 <version>2.7.0</version>
64+
</dependency>
65+
```
66+
5567
* 微信支付:
5668

5769
```xml
5870
<dependency>
5971
<groupId>com.github.binarywang</groupId>
6072
<artifactId>weixin-java-pay</artifactId>
61-
<version>2.6.0</version>
73+
<version>2.7.0</version>
6274
</dependency>
6375
```
6476

@@ -68,7 +80,7 @@
6880
<dependency>
6981
<groupId>com.github.binarywang</groupId>
7082
<artifactId>weixin-java-mp</artifactId>
71-
<version>2.6.0</version>
83+
<version>2.7.0</version>
7284
</dependency>
7385
```
7486

@@ -78,6 +90,6 @@
7890
<dependency>
7991
<groupId>com.github.binarywang</groupId>
8092
<artifactId>weixin-java-cp</artifactId>
81-
<version>2.6.0</version>
93+
<version>2.7.0</version>
8294
</dependency>
8395
```

weixin-java-common/build.gradle

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)