Skip to content

准备发布新版本2.4.0 #87

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 47 commits into from
Nov 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
8dadf49
更改版本号为snapshot版本
binarywang Nov 1, 2016
fad9aba
将httpclient显式进行依赖,以便于客户端优先使用配置的版本
binarywang Nov 1, 2016
8c00299
同步更新gradle相关配置
binarywang Nov 1, 2016
3ed717a
Update README.md
binarywang Nov 4, 2016
6cf7b08
去掉模版消息里无用的topcolor参数
binarywang Nov 4, 2016
1bd4f68
完善模板消息发送的单元测试,加入颜色
binarywang Nov 4, 2016
f478ceb
按openid群发消息时提供setToUsers方法,方便客户端直接设置所有群发对象的openid列表
binarywang Nov 4, 2016
e3fd108
Update README.md
binarywang Nov 8, 2016
109cab8
Update README.md
binarywang Nov 8, 2016
e4df6c8
重构优化XStreamTransformer代码
binarywang Nov 9, 2016
a887198
补充public方法的注释
binarywang Nov 9, 2016
fce1c2f
Update README.md
binarywang Nov 10, 2016
6dccfc7
upgrade version for maven-compiler-plugin
binarywang Nov 14, 2016
44d6b95
Update README.md
binarywang Nov 14, 2016
86160ca
更新javadoc
binarywang Nov 16, 2016
efa59d5
Update README.md
binarywang Nov 16, 2016
c84767c
Update README.md
binarywang Nov 16, 2016
0b0fbcd
使用大写L代替小写l,以免容易误解
binarywang Nov 17, 2016
25c792b
补充完善部分缺失的javadoc
binarywang Nov 17, 2016
88f0eb8
Update README.md
binarywang Nov 17, 2016
6d01fa5
修改WxCpMessage中agentId的数据类型, String-> Integer
Nov 16, 2016
a37a869
Merge pull request #79 from withinthefog/agentid-fix
binarywang Nov 18, 2016
088a972
为WxMpConfigStorage接口增加autoRefreshToken方法,以方便客户端设置是否自动刷新token. for #77
binarywang Nov 18, 2016
e4d5545
reformat some code
binarywang Nov 21, 2016
72d6aad
修复 #80 menuCreate()方法代码的问题,and reformat code
binarywang Nov 21, 2016
b09c5ae
Merge pull request #1 from wechat-group/develop
ZhaoxiongTan Nov 21, 2016
5f20d2c
图文消息统计接口, statDate类型改为String
ZhaoxiongTan Nov 21, 2016
9eadcf5
Merge pull request #81 from ZhaoxiongTan/develop
binarywang Nov 21, 2016
0acde03
修改获取Token/Ticket时的同步机制,改由通过锁来进行同步,由WxMpConfigStorage来提供锁实现。
ericlogic Nov 21, 2016
6278161
Merge pull request #82 from iwareserictsai/develop
binarywang Nov 22, 2016
b3778d1
添加贡献者信息
binarywang Nov 22, 2016
077f39c
添加贡献者信息
binarywang Nov 22, 2016
33ef6eb
修复#82引入代码导致的单元测试失败的问题
binarywang Nov 22, 2016
a26715c
增加对微信硬件平台事件消息的支持
Nov 24, 2016
1bc2a5c
部分实现微信支付查询退款的接口 for #59
binarywang Nov 24, 2016
fd4505d
Merge pull request #83 from johnnytung/develop
binarywang Nov 25, 2016
95821da
实现获取自定义菜单配置的接口 for #70
binarywang Nov 25, 2016
33de0d8
添加贡献者信息
binarywang Nov 25, 2016
160f608
test enhancement for template message
binarywang Nov 28, 2016
5bb6a24
reformat code
binarywang Nov 28, 2016
9d06a69
增加查询红包记录的接口 for #73
binarywang Nov 28, 2016
baf92b6
完善注释
binarywang Nov 29, 2016
eb9c55d
修正部分接口的注释中文档链接地址为新的文档地址
binarywang Nov 29, 2016
ef15580
一些小的代码调整
binarywang Nov 29, 2016
23f344b
修正WxMpXmlMessage中,设备id的XStreamAlias为DeviceID
Nov 30, 2016
19dc664
Merge pull request #85 from johnnytung/develop
binarywang Nov 30, 2016
6ca78bb
升级版本为2.4.0
binarywang Nov 30, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ test-config.xml
/gradle/
*.bat
/gradlew
**/build/

# OSX
# Icon must end with two \r
Expand Down
51 changes: 40 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Weixin Java Tools 微信公众号/企业号开发Java SDK
## ![Maven Central](https://img.shields.io/maven-central/v/com.github.binarywang/weixin-java-parent.svg) [![Build Status](https://travis-ci.org/wechat-group/weixin-java-tools.svg?branch=develop)](https://travis-ci.org/wechat-group/weixin-java-tools) [![Join QQ Group](http://pub.idqqimg.com/wpa/images/group.png)](http://jq.qq.com/?_wv=1027&k=40lRskK)

Weixin Java Tools 微信公众号/企业号开发Java SDK
=====================================
[![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)
[![Build Status](https://travis-ci.org/wechat-group/weixin-java-tools.svg?branch=develop)](https://travis-ci.org/wechat-group/weixin-java-tools)

### 注意:
1. ***本项目Fork自chanjarster/weixin-java-tools,但由于原项目已停止维护,故单独维护和发布,且发布到maven上的groupId也会不同,详细信息见下文。***
Expand All @@ -11,20 +12,22 @@
===========

## 开发交流方式及注意事项:
1. QQ群:343954419 [![Join QQ Group](http://pub.idqqimg.com/wpa/images/group.png)](http://jq.qq.com/?_wv=1027&k=40lRskK)
1. QQ群:343954419(推荐点击按钮入群: [![Join QQ Group](http://pub.idqqimg.com/wpa/images/group.png)](http://shang.qq.com/wpa/qunwpa?idkey=731dc3e7ea31ebe25376cc1a791445468612c63fd0e9e05399b088ec81fd9e15) 或 [![Join QQ Group](http://pub.idqqimg.com/wpa/images/group.png)](http://jq.qq.com/?_wv=1027&k=40lRskK),如果无反应,可以自行搜索群号进行添加 )
1. 由于群容量有限即将爆满,现开启付费入群模式,并不定期清理长时间不活跃人士;
1. 微信群: 因微信群已达到100人限制,故如有想加入微信群的,请入QQ群后联系管理员,提供微信号以便邀请加入;
1. 新手提问前,请先阅读此文章:http://t.cn/RV93MRB
1. 寻求帮助时需贴代码或大长串异常信息的,请利用http://paste.ubuntu.com
1. 有功能需求或由于微信官方接口调整导致的代码问题,可以直接提出issue,便于讨论追踪问题;
1. 详细开发文档请看 [Wiki](https://github.com/wechat-group/weixin-java-tools/wiki),部分文档可能未能及时更新,如有发现,可以及时上报或者自行修改。
1. 微信公众号官方文档入口地址:http://mp.weixin.qq.com/wiki (注意,从网上搜到的文档有的虽然地址前面跟这个一样,但明显左侧菜单不一致,是旧的文档,注意不要看错了文档)。
1. 微信公众号官方文档入口地址:http://mp.weixin.qq.com/wiki (注意,从网上搜到的文档有的虽然地址前面跟这个一样,但明显左侧菜单不一致,是旧的文档,注意不要看错文档)。
1. 各个模块的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/)

===========

## 版本说明
1. 本项目定为每月发布一次正式版,版本号格式为X.X.0(如2.1.0,2.2.0等),月初或月底发布新版本,遇到重大问题需修复会及时提交新版本,欢迎大家随时提交Pull Request;
1. BUG修复和新特性一般会先发布成小版本作为临时版本(如2.0.1,2.0.2等,即尾号不为0,以区别于正式版);
1. 目前最新版本号为 ![Maven Central](https://img.shields.io/maven-central/v/com.github.binarywang/weixin-java-parent.svg) ,也可以通过访问链接 [【公众号】](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)
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-mp%22) 、[【企业号】](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.github.binarywang%22%20AND%20a%3A%22weixin-java-cp%22)
分别查看所有最新的版本。

## Maven & Gradle
Expand Down Expand Up @@ -69,16 +72,42 @@ compile 'com.github.binarywang:weixin-java-cp:2.3.0'
* https://git.coding.net/binarywang/weixin-java-tools.git

===========
## 目前可参考的Demo项目有三个(目前都是公众号的,风格不同,欢迎提供更多的demo供新手参考):
1. https://github.com/wechat-group/weixin-mp-demo
1. https://github.com/wechat-group/weixin-mp-demo-springboot
## 可参考的Demo项目
#### 目前都是公众号的,风格不同,欢迎提供更多的demo供新手参考:
1. https://github.com/wechat-group/weixin-mp-demo
1. https://github.com/wechat-group/weixin-mp-multi-demo (支持多公众号)
1. https://github.com/wechat-group/weixin-java-tools-springmvc
1. https://github.com/wechat-group/weixin-mp-demo-springboot


===========
## 关于代码贡献
1. 非常欢迎和感谢对本项目发起Pull Request的同学,本项目代码风格为使用2个空格代表一个Tab,因此在提交代码时请注意一下,否则很容易在IDE格式化代码后与原代码产生大量diff,这样会给其他人阅读代码带来极大的困扰。
1. 为了便于设置,本项目引入editorconfig插件,请使用eclipse的同学在贡献代码前安装相关插件,IntelliJ IDEA则自带支持,无需额外安装插件。
1. 本项目可以采用两种方式接受代码贡献:
* 第一种就是基于[Git Flow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow)开发流程,因此在发起Pull Request的时候请选择develop分支,详细步骤参考后文。
* 另外一种贡献代码的方式就是加入SDK Developers开发组,前提是对自己的代码足够自信就可以申请加入,加入之后可以随时直接提交代码,但要注意对所做的修改或新增的代码进行单元测试,保证提交代码没有明显问题,具体加入方式,请咨询QQ群管理员[![点击这里给我发消息](http://wpa.qq.com/pa?p=2:1211415707:51)](http://wpa.qq.com/msgrd?v=3&uin=1211415707&site=qq&menu=yes)。

1. 第一种就是基于[Git Flow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow)开发流程,因此在发起Pull Request的时候请选择develop分支。
1. 另外一种贡献代码的方式就是加入SDK Developers开发组,前提是对自己的代码足够自信就可以申请加入,加入之后可以随时直接提交代码,但要注意对所做的修改或新增的代码进行单元测试,保证提交代码没有明显问题,具体加入方式,请咨询管理员。
## PR方式贡献代码步骤
* 在 GitHub 上 `fork` 到自己的仓库,如 `my_user/weixin-java-tools`,然后 `clone` 到本地,并设置用户信息。
```
$ git clone git@github.com:my_user/weixin-java-tools.git
$ cd weixin-java-tools
$ git config user.name "yourname"
$ git config user.email "your email"
```
* 修改代码后提交,并推送到自己的仓库。
```
$ #do some change on the content
$ git commit -am "Fix issue #1: change something"
$ git push
```
* 在 GitHub 网站上提交 Pull Request。
* 定期使用项目仓库内容更新自己仓库内容。
```
$ git remote add upstream https://github.com/wechat-group/weixin-java-tools
$ git fetch upstream
$ git checkout develop
$ git rebase upstream/develop
$ git push -f origin develop
```
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ allprojects {
apply plugin: 'maven'

group = 'com.github.binarywang'
version = '2.3.0'
version = '2.4.0-SNAPSHOT'
}

subprojects {
Expand All @@ -21,6 +21,7 @@ subprojects {
dependencies {
compile group: 'org.slf4j', name: 'slf4j-api', version:'1.7.10'
compile group: 'org.apache.httpcomponents', name: 'httpmime', version:'4.5'
compile group: 'org.apache.httpcomponents', name: 'httpclient', version:'4.5'
compile group: 'com.google.code.gson', name: 'gson', version:'2.7'
compile group: 'com.google.guava', name: 'guava', version:'19.0'
compile group: 'commons-codec', name: 'commons-codec', version:'1.10'
Expand Down
29 changes: 25 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.binarywang</groupId>
<artifactId>weixin-java-parent</artifactId>
<version>2.3.0</version>
<version>2.4.0</version>
<packaging>pom</packaging>
<name>WeiXin Java Tools - Parent</name>
<description>微信公众号、企业号上级POM</description>
Expand Down Expand Up @@ -54,6 +54,21 @@
<email>aimilin@yeah.net</email>
<url>https://github.com/aimilin6688</url>
</developer>
<developer>
<name>Eric.Tsai</name>
<email>xiaodong.cai.ks@gmail.com</email>
<url>https://github.com/iwareserictsai</url>
</developer>
<developer>
<name>withinthefog</name>
<email>withinthefog@gmail.com</email>
<url>https://github.com/withinthefog</url>
</developer>
<developer>
<name>Keung</name>
<email>dongfuqiang1988@163.com</email>
<url>https://github.com/johnnytung</url>
</developer>
</developers>

<scm>
Expand All @@ -70,6 +85,9 @@
</modules>

<properties>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<downloadJavadocs>true</downloadJavadocs>
<downloadSources>true</downloadSources>
Expand Down Expand Up @@ -97,6 +115,11 @@
<version>${logback.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>${httpclient.version}</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
Expand Down Expand Up @@ -296,10 +319,8 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<version>3.6.0</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
Expand Down
4 changes: 2 additions & 2 deletions weixin-java-common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dependencies {
testCompile group: 'org.testng', name: 'testng', version:'6.8.7'
testCompile group: 'org.mockito', name: 'mockito-all', version:'1.9.5'
testCompile group: 'com.google.inject', name: 'guice', version:'3.0'
testCompile group: 'org.eclipse.jetty', name: 'jetty-server', version:'9.3.0.M0'
testCompile group: 'org.eclipse.jetty', name: 'jetty-servlet', version:'9.3.0.M0'
testCompile group: 'org.eclipse.jetty', name: 'jetty-server', version:'9.3.0.RC0'
testCompile group: 'org.eclipse.jetty', name: 'jetty-servlet', version:'9.3.0.RC0'
}
test.useTestNG()
2 changes: 1 addition & 1 deletion weixin-java-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.github.binarywang</groupId>
<artifactId>weixin-java-parent</artifactId>
<version>2.3.0</version>
<version>2.4.0</version>
</parent>

<artifactId>weixin-java-common</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,13 @@ public class WxConsts {
public static final String XML_MSG_LOCATION = "location";
public static final String XML_MSG_LINK = "link";
public static final String XML_MSG_EVENT = "event";
public static final String XML_MSG_DEVICE_TEXT = "device_text";
public static final String XML_MSG_DEVICE_EVENT = "device_event";
public static final String XML_MSG_DEVICE_STATUS = "device_status";
public static final String XML_MSG_HARDWARE = "hardware";
public static final String XML_TRANSFER_CUSTOMER_SERVICE = "transfer_customer_service";


///////////////////////
// 主动发送消息(即客服消息)的消息类型
///////////////////////
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package me.chanjar.weixin.common.bean.menu;

import me.chanjar.weixin.common.util.ToStringUtils;
import me.chanjar.weixin.common.util.json.WxGsonBuilder;

import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Serializable;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;

import me.chanjar.weixin.common.bean.menu.WxMenuButton;
import me.chanjar.weixin.common.util.json.WxGsonBuilder;

/**
* 企业号菜单
* 菜单(公众号和企业号共用的)
*
* @author Daniel Qian
*/
Expand Down Expand Up @@ -61,9 +61,7 @@ public String toJson() {

@Override
public String toString() {
return "WxMenu{" +
"buttons=" + this.buttons +
'}';
return ToStringUtils.toSimpleString(this);
}

}
4 changes: 2 additions & 2 deletions weixin-java-cp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dependencies {
testCompile group: 'org.testng', name: 'testng', version:'6.8.7'
testCompile group: 'org.mockito', name: 'mockito-all', version:'1.9.5'
testCompile group: 'com.google.inject', name: 'guice', version:'3.0'
testCompile group: 'org.eclipse.jetty', name: 'jetty-server', version:'9.3.0.M0'
testCompile group: 'org.eclipse.jetty', name: 'jetty-servlet', version:'9.3.0.M0'
testCompile group: 'org.eclipse.jetty', name: 'jetty-server', version:'9.3.0.RC0'
testCompile group: 'org.eclipse.jetty', name: 'jetty-servlet', version:'9.3.0.RC0'
}
test.useTestNG()
2 changes: 1 addition & 1 deletion weixin-java-cp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.github.binarywang</groupId>
<artifactId>weixin-java-parent</artifactId>
<version>2.3.0</version>
<version>2.4.0</version>
</parent>

<artifactId>weixin-java-cp</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public interface WxCpConfigStorage {

String getCorpSecret();

String getAgentId();
Integer getAgentId();

String getToken();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class WxCpInMemoryConfigStorage implements WxCpConfigStorage {
protected volatile String token;
protected volatile String accessToken;
protected volatile String aesKey;
protected volatile String agentId;
protected volatile Integer agentId;
protected volatile long expiresTime;

protected volatile String oauth2redirectUri;
Expand Down Expand Up @@ -146,11 +146,11 @@ public void setAesKey(String aesKey) {
}

@Override
public String getAgentId() {
public Integer getAgentId() {
return this.agentId;
}

public void setAgentId(String agentId) {
public void setAgentId(Integer agentId) {
this.agentId = agentId;
}

Expand Down
Loading