From 56ebb03e11e980af65d2fe14fc54f441fb5dfbff Mon Sep 17 00:00:00 2001 From: Binary Wang Date: Tue, 4 Oct 2016 22:30:57 +0800 Subject: [PATCH 01/41] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0d02922a..c833d230 100644 --- a/README.md +++ b/README.md @@ -19,9 +19,9 @@ =========== ## 版本说明 -1. 本项目定为每月发布一次正式版,版本号格式为X.X.0(如2.0.0,2.1.0等),月初或月底发布新版本,遇到重大问题需修复会及时提交新版本,欢迎大家随时提交Pull Request; +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://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) 分别查看所有最新的版本。 ## Maven & Gradle From 711a2e481393163a899c64601f82a3b94a267e2b Mon Sep 17 00:00:00 2001 From: Binary Wang Date: Tue, 4 Oct 2016 22:33:40 +0800 Subject: [PATCH 02/41] Update README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c833d230..f155ace8 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,8 @@ gradle: compile 'com.github.binarywang:weixin-java-cp:2.2.0' ``` +=========== + #### 本项目主要存放在github上,地址为 : * https://github.com/wechat-group/weixin-java-tools * ===========但同时会在其他几个网站同步更新,地址分别是: @@ -63,11 +65,12 @@ compile 'com.github.binarywang:weixin-java-cp:2.2.0' * http://git.oschina.net/binary/weixin-java-tools * https://git.coding.net/binarywang/weixin-java-tools.git - +=========== ## 目前可参考的Demo项目有两个: 1. https://github.com/wechat-group/weixin-mp-demo 1. https://github.com/wechat-group/weixin-java-tools-springmvc +=========== ## 关于代码贡献 1. 非常欢迎和感谢对本项目发起Pull Request的同学,本项目代码风格为使用2个空格代表一个Tab,因此在提交代码时请注意一下,否则很容易在IDE格式化代码后与原代码产生大量diff,这样会给其他人阅读代码带来极大的困扰。 1. 为了便于设置,本项目引入editorconfig插件,请使用eclipse的同学在贡献代码前安装相关插件,IntelliJ IDEA则自带支持,无需额外安装插件。 From 86fd57f5ac680cdb722d2c111dbf6d7845ce328d Mon Sep 17 00:00:00 2001 From: Binary Wang Date: Fri, 7 Oct 2016 10:14:05 +0800 Subject: [PATCH 03/41] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index f155ace8..c0dfb3fb 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ ### 注意: 1. ***本项目Fork自chanjarster/weixin-java-tools,但由于原项目已停止维护,故单独维护和发布,且发布到maven上的groupId也会不同,详细信息见下文。*** 1. ***自2.0.0版本以来,公众号的接口调整比较大,主要是为了解决主接口类过于庞大不方便管理的问题,将接口实现代码按模块进行拆分。*** +1. 本项目最低要求的JDK版本是7,如果需要较低版本,比如支持JDK6的版本,请参考 https://github.com/binarywang/weixin-java-tools-for-jdk6 ,其他版本则需要自己实现; 1. 最新更新:2016-09-30 发布2.2.0正式版! =========== From d948afeb6c68b6f18d1c255e205fa4e3a897d031 Mon Sep 17 00:00:00 2001 From: Binary Wang Date: Fri, 7 Oct 2016 10:14:28 +0800 Subject: [PATCH 04/41] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c0dfb3fb..aeabcc48 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ ### 注意: 1. ***本项目Fork自chanjarster/weixin-java-tools,但由于原项目已停止维护,故单独维护和发布,且发布到maven上的groupId也会不同,详细信息见下文。*** 1. ***自2.0.0版本以来,公众号的接口调整比较大,主要是为了解决主接口类过于庞大不方便管理的问题,将接口实现代码按模块进行拆分。*** -1. 本项目最低要求的JDK版本是7,如果需要较低版本,比如支持JDK6的版本,请参考 https://github.com/binarywang/weixin-java-tools-for-jdk6 ,其他版本则需要自己实现; +1. 本项目最低要求的JDK版本是7,如果需要较低版本,比如支持JDK6的版本,请参考 https://github.com/binarywang/weixin-java-tools-for-jdk6 ,其他版本则需要自己改造实现; 1. 最新更新:2016-09-30 发布2.2.0正式版! =========== From 63a1558206269571d131873cbdb2317836d73797 Mon Sep 17 00:00:00 2001 From: Binary Wang Date: Fri, 7 Oct 2016 14:07:06 +0800 Subject: [PATCH 05/41] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index aeabcc48..d4440332 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ ### 注意: 1. ***本项目Fork自chanjarster/weixin-java-tools,但由于原项目已停止维护,故单独维护和发布,且发布到maven上的groupId也会不同,详细信息见下文。*** 1. ***自2.0.0版本以来,公众号的接口调整比较大,主要是为了解决主接口类过于庞大不方便管理的问题,将接口实现代码按模块进行拆分。*** -1. 本项目最低要求的JDK版本是7,如果需要较低版本,比如支持JDK6的版本,请参考 https://github.com/binarywang/weixin-java-tools-for-jdk6 ,其他版本则需要自己改造实现; +1. 本SDK要求的最低JDK版本是7,为解决少量还在使用JDK6的用户,特意抽出独立的代码分支项目,请参考 https://github.com/binarywang/weixin-java-tools-for-jdk ,其他更早的JDK版本则需要自己改造实现; 1. 最新更新:2016-09-30 发布2.2.0正式版! =========== From 4ce5ef3812289fe2bca0440d981c3346f9f65832 Mon Sep 17 00:00:00 2001 From: Binary Wang Date: Fri, 7 Oct 2016 14:16:24 +0800 Subject: [PATCH 06/41] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d4440332..c473c9cd 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ ### 注意: 1. ***本项目Fork自chanjarster/weixin-java-tools,但由于原项目已停止维护,故单独维护和发布,且发布到maven上的groupId也会不同,详细信息见下文。*** 1. ***自2.0.0版本以来,公众号的接口调整比较大,主要是为了解决主接口类过于庞大不方便管理的问题,将接口实现代码按模块进行拆分。*** -1. 本SDK要求的最低JDK版本是7,为解决少量还在使用JDK6的用户,特意抽出独立的代码分支项目,请参考 https://github.com/binarywang/weixin-java-tools-for-jdk ,其他更早的JDK版本则需要自己改造实现; +1. 本SDK要求的最低JDK版本是7,为解决少量还在使用JDK6的用户,特意抽出独立的代码分支项目,请参考 https://github.com/binarywang/weixin-java-tools-for-jdk6 ,其他更早的JDK版本则需要自己改造实现; 1. 最新更新:2016-09-30 发布2.2.0正式版! =========== From 3a4b9edf4b7ec29c4946ba262e38765a50a7cb1c Mon Sep 17 00:00:00 2001 From: Binary Wang Date: Tue, 11 Oct 2016 11:27:36 +0800 Subject: [PATCH 07/41] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c473c9cd..9be8db94 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ compile 'com.github.binarywang:weixin-java-cp:2.2.0' * https://git.coding.net/binarywang/weixin-java-tools.git =========== -## 目前可参考的Demo项目有两个: +## 目前可参考的Demo项目有两个(目前都是公众号的,风格不同,欢迎提供更多的demo供新手参考): 1. https://github.com/wechat-group/weixin-mp-demo 1. https://github.com/wechat-group/weixin-java-tools-springmvc From 67c8b613b65f95314eb05c897b9763253dffe028 Mon Sep 17 00:00:00 2001 From: Binary Wang Date: Tue, 18 Oct 2016 00:14:50 +0800 Subject: [PATCH 08/41] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9be8db94..7c1cee44 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ ### 注意: 1. ***本项目Fork自chanjarster/weixin-java-tools,但由于原项目已停止维护,故单独维护和发布,且发布到maven上的groupId也会不同,详细信息见下文。*** 1. ***自2.0.0版本以来,公众号的接口调整比较大,主要是为了解决主接口类过于庞大不方便管理的问题,将接口实现代码按模块进行拆分。*** -1. 本SDK要求的最低JDK版本是7,为解决少量还在使用JDK6的用户,特意抽出独立的代码分支项目,请参考 https://github.com/binarywang/weixin-java-tools-for-jdk6 ,其他更早的JDK版本则需要自己改造实现; +1. 本SDK要求的最低JDK版本是7,为满足少量还在使用JDK6的用户的需求,特意抽出独立的代码分支项目,请参考 https://github.com/binarywang/weixin-java-tools-for-jdk6 ,其他更早的JDK版本则需要自己改造实现; 1. 最新更新:2016-09-30 发布2.2.0正式版! =========== From 3dce69806a27d0e98d76d4e665e622fbdb966444 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Binary=EF=BC=88=E7=8F=AD=E7=BA=B3=E7=9D=BF=EF=BC=89?= Date: Fri, 21 Oct 2016 12:30:05 +0800 Subject: [PATCH 09/41] Update README.md --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7c1cee44..07040c52 100644 --- a/README.md +++ b/README.md @@ -11,9 +11,11 @@ =========== ## 开发交流方式: -1. ***入群须知:为保证入群成员质量,请申请入群前,先Star本项目,然后在申请入群时,输入您的Github帐号ID,以便管理员核对,ID即你的github主页地址https://github.com/XXXX 中最后的部分XXXX的内容,或者在github网页右上角点击头像后查看Signed in as后方内容。*** +1. ***QQ群入群须知:为保证入群成员质量,请申请入群前,先Star本项目,然后在申请入群时,输入您的Github帐号ID,以便管理员核对,ID即你的github主页地址https://github.com/XXXX 中最后的部分XXXX的内容,或者在github网页右上角点击头像后查看Signed in as后方内容。*** +1. 新手提问前,请先阅读此文章:http://t.cn/RV93MRB +1. 寻求帮助时需贴代码或大长串异常信息的,请利用http://paste.ubuntu.com 1. QQ群:343954419 [![Join QQ Group](http://pub.idqqimg.com/wpa/images/group.png)](http://shang.qq.com/wpa/qunwpa?idkey=078f7a153d243853e24cf2b542e7a6ccbf2a592bc138080f84d11297f736ec46) -1. 微信群: 因二维码有时间限制,如有想加入微信群的,请入QQ群后咨询获取最新入群二维码; +1. 微信群: 因微信群已达到100人限制,故如有想加入微信群的,请入QQ群后联系管理员,提供微信号以便邀请加入; 1. 有功能需求或由于微信官方接口调整导致的代码问题,可以直接提出issue,便于讨论追踪问题; 1. 详细开发文档请看 [Wiki](https://github.com/wechat-group/weixin-java-tools/wiki)。 From c20e02bb40c273ba538b4c98a2818a6881b0cd5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Binary=EF=BC=88=E7=8F=AD=E7=BA=B3=E7=9D=BF=EF=BC=89?= Date: Sun, 23 Oct 2016 16:05:39 +0800 Subject: [PATCH 10/41] Update README.md --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 07040c52..5bcc3d14 100644 --- a/README.md +++ b/README.md @@ -11,11 +11,10 @@ =========== ## 开发交流方式: -1. ***QQ群入群须知:为保证入群成员质量,请申请入群前,先Star本项目,然后在申请入群时,输入您的Github帐号ID,以便管理员核对,ID即你的github主页地址https://github.com/XXXX 中最后的部分XXXX的内容,或者在github网页右上角点击头像后查看Signed in as后方内容。*** -1. 新手提问前,请先阅读此文章:http://t.cn/RV93MRB -1. 寻求帮助时需贴代码或大长串异常信息的,请利用http://paste.ubuntu.com 1. QQ群:343954419 [![Join QQ Group](http://pub.idqqimg.com/wpa/images/group.png)](http://shang.qq.com/wpa/qunwpa?idkey=078f7a153d243853e24cf2b542e7a6ccbf2a592bc138080f84d11297f736ec46) 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)。 From cf6559a67411f138582908d76d0b6baf21da5f28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Binary=EF=BC=88=E7=8F=AD=E7=BA=B3=E7=9D=BF=EF=BC=89?= Date: Sun, 23 Oct 2016 16:07:51 +0800 Subject: [PATCH 11/41] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5bcc3d14..0c8848a2 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ =========== -## 开发交流方式: +## 开发交流方式及注意事项: 1. QQ群:343954419 [![Join QQ Group](http://pub.idqqimg.com/wpa/images/group.png)](http://shang.qq.com/wpa/qunwpa?idkey=078f7a153d243853e24cf2b542e7a6ccbf2a592bc138080f84d11297f736ec46) 1. 微信群: 因微信群已达到100人限制,故如有想加入微信群的,请入QQ群后联系管理员,提供微信号以便邀请加入; 1. 新手提问前,请先阅读此文章:http://t.cn/RV93MRB From f5a621966fe2758f58b0547deb61b9c5176077d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Binary=EF=BC=88=E7=8F=AD=E7=BA=B3=E7=9D=BF=EF=BC=89?= Date: Mon, 24 Oct 2016 11:45:16 +0800 Subject: [PATCH 12/41] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0c8848a2..09fb3a70 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ =========== ## 开发交流方式及注意事项: -1. QQ群:343954419 [![Join QQ Group](http://pub.idqqimg.com/wpa/images/group.png)](http://shang.qq.com/wpa/qunwpa?idkey=078f7a153d243853e24cf2b542e7a6ccbf2a592bc138080f84d11297f736ec46) +1. QQ群:343954419(因群人数限制爆满,故开启付费加群方式,感谢理解) [![Join QQ Group](http://pub.idqqimg.com/wpa/images/group.png)](http://shang.qq.com/wpa/qunwpa?idkey=078f7a153d243853e24cf2b542e7a6ccbf2a592bc138080f84d11297f736ec46) 1. 微信群: 因微信群已达到100人限制,故如有想加入微信群的,请入QQ群后联系管理员,提供微信号以便邀请加入; 1. 新手提问前,请先阅读此文章:http://t.cn/RV93MRB 1. 寻求帮助时需贴代码或大长串异常信息的,请利用http://paste.ubuntu.com From 858ebb7acb1e44de605e9842c75c5550df1343e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Binary=EF=BC=88=E7=8F=AD=E7=BA=B3=E7=9D=BF=EF=BC=89?= Date: Mon, 24 Oct 2016 11:46:50 +0800 Subject: [PATCH 13/41] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 09fb3a70..471c6b76 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ =========== ## 开发交流方式及注意事项: -1. QQ群:343954419(因群人数限制爆满,故开启付费加群方式,感谢理解) [![Join QQ Group](http://pub.idqqimg.com/wpa/images/group.png)](http://shang.qq.com/wpa/qunwpa?idkey=078f7a153d243853e24cf2b542e7a6ccbf2a592bc138080f84d11297f736ec46) +1. QQ群:343954419(因群人数限制即将爆满,故开启付费加群方式并不定期清理不活跃人群,感谢理解) [![Join QQ Group](http://pub.idqqimg.com/wpa/images/group.png)](http://shang.qq.com/wpa/qunwpa?idkey=078f7a153d243853e24cf2b542e7a6ccbf2a592bc138080f84d11297f736ec46) 1. 微信群: 因微信群已达到100人限制,故如有想加入微信群的,请入QQ群后联系管理员,提供微信号以便邀请加入; 1. 新手提问前,请先阅读此文章:http://t.cn/RV93MRB 1. 寻求帮助时需贴代码或大长串异常信息的,请利用http://paste.ubuntu.com From d241e54ae6fccca8855516b2c05fc7974d3eba49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Binary=EF=BC=88=E7=8F=AD=E7=BA=B3=E7=9D=BF=EF=BC=89?= Date: Mon, 24 Oct 2016 11:50:09 +0800 Subject: [PATCH 14/41] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 471c6b76..81b1b00b 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ 1. 新手提问前,请先阅读此文章:http://t.cn/RV93MRB 1. 寻求帮助时需贴代码或大长串异常信息的,请利用http://paste.ubuntu.com 1. 有功能需求或由于微信官方接口调整导致的代码问题,可以直接提出issue,便于讨论追踪问题; -1. 详细开发文档请看 [Wiki](https://github.com/wechat-group/weixin-java-tools/wiki)。 +1. 详细开发文档请看 [Wiki](https://github.com/wechat-group/weixin-java-tools/wiki),部分文档可能未能及时更新,如有发现,可以及时上报或者自行修改。 =========== From 8c759bcee87f0ebb8677a1a39e30934372206ad8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Binary=EF=BC=88=E7=8F=AD=E7=BA=B3=E7=9D=BF=EF=BC=89?= Date: Mon, 24 Oct 2016 15:28:03 +0800 Subject: [PATCH 15/41] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 81b1b00b..96b2bcd8 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Weixin Java Tools 微信公众号/企业号开发Java SDK -## [![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)](https://github.com/ellerbrock/open-source-badge/) ![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) +## ![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) ### 注意: @@ -11,7 +11,7 @@ =========== ## 开发交流方式及注意事项: -1. QQ群:343954419(因群人数限制即将爆满,故开启付费加群方式并不定期清理不活跃人群,感谢理解) [![Join QQ Group](http://pub.idqqimg.com/wpa/images/group.png)](http://shang.qq.com/wpa/qunwpa?idkey=078f7a153d243853e24cf2b542e7a6ccbf2a592bc138080f84d11297f736ec46) +1. QQ群:343954419(因群人数限制即将爆满,故开启付费加群方式并不定期清理不活跃人群,感谢理解) [![Join QQ Group](http://pub.idqqimg.com/wpa/images/group.png)](http://jq.qq.com/?_wv=1027&k=40lRskK) 1. 微信群: 因微信群已达到100人限制,故如有想加入微信群的,请入QQ群后联系管理员,提供微信号以便邀请加入; 1. 新手提问前,请先阅读此文章:http://t.cn/RV93MRB 1. 寻求帮助时需贴代码或大长串异常信息的,请利用http://paste.ubuntu.com From 953892bee388ee741ffa9759423caf71c68522ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Binary=EF=BC=88=E7=8F=AD=E7=BA=B3=E7=9D=BF=EF=BC=89?= Date: Tue, 25 Oct 2016 15:38:29 +0800 Subject: [PATCH 16/41] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 96b2bcd8..c30808e9 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,8 @@ =========== ## 开发交流方式及注意事项: -1. QQ群:343954419(因群人数限制即将爆满,故开启付费加群方式并不定期清理不活跃人群,感谢理解) [![Join QQ Group](http://pub.idqqimg.com/wpa/images/group.png)](http://jq.qq.com/?_wv=1027&k=40lRskK) +1. ***QQ群入群须知:为保证入群成员质量,请申请入群前,先Star本项目,然后在申请入群时,输入您的Github帐号ID,以便管理员核对,ID即你的github主页地址https://github.com/XXXX 中最后的部分XXXX的内容,或者在github网页右上角点击头像后查看Signed in as后方内容。*** +1. QQ群:343954419 [![Join QQ Group](http://pub.idqqimg.com/wpa/images/group.png)](http://jq.qq.com/?_wv=1027&k=40lRskK) 1. 微信群: 因微信群已达到100人限制,故如有想加入微信群的,请入QQ群后联系管理员,提供微信号以便邀请加入; 1. 新手提问前,请先阅读此文章:http://t.cn/RV93MRB 1. 寻求帮助时需贴代码或大长串异常信息的,请利用http://paste.ubuntu.com From 1a468266a229e452287893a4b2e11978450642b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Binary=EF=BC=88=E7=8F=AD=E7=BA=B3=E7=9D=BF=EF=BC=89?= Date: Tue, 25 Oct 2016 17:17:17 +0800 Subject: [PATCH 17/41] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index c30808e9..adeee40c 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,6 @@ =========== ## 开发交流方式及注意事项: -1. ***QQ群入群须知:为保证入群成员质量,请申请入群前,先Star本项目,然后在申请入群时,输入您的Github帐号ID,以便管理员核对,ID即你的github主页地址https://github.com/XXXX 中最后的部分XXXX的内容,或者在github网页右上角点击头像后查看Signed in as后方内容。*** 1. QQ群:343954419 [![Join QQ Group](http://pub.idqqimg.com/wpa/images/group.png)](http://jq.qq.com/?_wv=1027&k=40lRskK) 1. 微信群: 因微信群已达到100人限制,故如有想加入微信群的,请入QQ群后联系管理员,提供微信号以便邀请加入; 1. 新手提问前,请先阅读此文章:http://t.cn/RV93MRB From 98a83ef615946d160b2c4253ec5500b8ae4e334c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Binary=EF=BC=88=E7=8F=AD=E7=BA=B3=E7=9D=BF=EF=BC=89?= Date: Thu, 27 Oct 2016 15:56:40 +0800 Subject: [PATCH 18/41] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index adeee40c..bbc7b881 100644 --- a/README.md +++ b/README.md @@ -68,8 +68,9 @@ compile 'com.github.binarywang:weixin-java-cp:2.2.0' * https://git.coding.net/binarywang/weixin-java-tools.git =========== -## 目前可参考的Demo项目有两个(目前都是公众号的,风格不同,欢迎提供更多的demo供新手参考): +## 目前可参考的Demo项目有三个(目前都是公众号的,风格不同,欢迎提供更多的demo供新手参考): 1. https://github.com/wechat-group/weixin-mp-demo +1. https://github.com/wechat-group/weixin-mp-demo-springboot 1. https://github.com/wechat-group/weixin-java-tools-springmvc =========== From beaa7fcc268b82c58568527777994101833a3596 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Binary=EF=BC=88=E7=8F=AD=E7=BA=B3=E7=9D=BF=EF=BC=89?= Date: Thu, 27 Oct 2016 18:09:22 +0800 Subject: [PATCH 19/41] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index bbc7b881..ba790a61 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ 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, (注意,从网上搜到的文档有的虽然地址前面跟这个一样,但明显左侧菜单不一致,是旧的文档,注意不要看错了文档)。 =========== From f2e3c536f1aa84dfe50bab0f2323d974197bf67a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Binary=EF=BC=88=E7=8F=AD=E7=BA=B3=E7=9D=BF=EF=BC=89?= Date: Thu, 27 Oct 2016 18:11:11 +0800 Subject: [PATCH 20/41] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ba790a61..223ce24c 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ 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 (注意,从网上搜到的文档有的虽然地址前面跟这个一样,但明显左侧菜单不一致,是旧的文档,注意不要看错了文档)。 =========== From 7b8d7f32c3495447228ab5bd4663245b6824a93b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Binary=EF=BC=88=E7=8F=AD=E7=BA=B3=E7=9D=BF=EF=BC=89?= Date: Fri, 28 Oct 2016 17:23:23 +0800 Subject: [PATCH 21/41] Update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index fe20293a..6b08014d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,4 +10,4 @@ branches: notifications: email: - - binarywang@qq.com + - binaryw@qq.com From c71d4dfa36500e9a9dd1488e4ec1544de36e4bae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Binary=EF=BC=88=E7=8F=AD=E7=BA=B3=E7=9D=BF=EF=BC=89?= Date: Fri, 28 Oct 2016 18:31:16 +0800 Subject: [PATCH 22/41] Update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6b08014d..65cf5e12 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ language: java jdk: - oraclejdk7 -script: "mvn clean install -Dmaven.test.skip=true" +script: "mvn clean package -Dmaven.test.skip=true" branches: only: From f73cc99bb1532975afa36a6226cb3d4111f2778f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Binary=EF=BC=88=E7=8F=AD=E7=BA=B3=E7=9D=BF=EF=BC=89?= Date: Fri, 4 Nov 2016 11:05:10 +0800 Subject: [PATCH 23/41] Update README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 035ec8ad..637a0784 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # 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) +===================================== +[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.binarywang/weixin-java-mp/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.binarywang/weixin-java-mp) +[![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) ### 注意: From a0c9696920932f3f97c5a1fc1413601b824381e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Binary=EF=BC=88=E7=8F=AD=E7=BA=B3=E7=9D=BF=EF=BC=89?= Date: Fri, 4 Nov 2016 11:05:56 +0800 Subject: [PATCH 24/41] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 637a0784..6e6469d6 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,7 @@ # Weixin Java Tools 微信公众号/企业号开发Java SDK ===================================== [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.binarywang/weixin-java-mp/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.binarywang/weixin-java-mp) -[![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) +[![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) ### 注意: From ddd16f694c6a265dc63f6317dcbf51ac610faa78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Binary=EF=BC=88=E7=8F=AD=E7=BA=B3=E7=9D=BF=EF=BC=89?= Date: Fri, 4 Nov 2016 11:09:08 +0800 Subject: [PATCH 25/41] Update README.md --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6e6469d6..a42e770b 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,7 @@ -# Weixin Java Tools 微信公众号/企业号开发Java SDK +Weixin Java Tools 微信公众号/企业号开发Java SDK ===================================== -[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.binarywang/weixin-java-mp/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.binarywang/weixin-java-mp) -[![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) - +[![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也会不同,详细信息见下文。*** @@ -26,7 +25,7 @@ ## 版本说明 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) ,也可以通过访问链接 [【公众号】](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 From 5566ab4b2bcb67b6b345158218702973e4b52ac8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Binary=EF=BC=88=E7=8F=AD=E7=BA=B3=E7=9D=BF=EF=BC=89?= Date: Fri, 4 Nov 2016 11:11:17 +0800 Subject: [PATCH 26/41] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a42e770b..7d7b23b0 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Weixin Java Tools 微信公众号/企业号开发Java SDK ## 版本说明 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://maven-badges.herokuapp.com/maven-central/com.github.binarywang/weixin-java-parent/badge.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 From 27fe891f8f069eb458139c04f857e455b252599a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Binary=EF=BC=88=E7=8F=AD=E7=BA=B3=E7=9D=BF=EF=BC=89?= Date: Tue, 8 Nov 2016 10:47:34 +0800 Subject: [PATCH 27/41] Update README.md --- README.md | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7d7b23b0..493b95e2 100644 --- a/README.md +++ b/README.md @@ -81,5 +81,29 @@ compile 'com.github.binarywang:weixin-java-cp:2.3.0' 1. 为了便于设置,本项目引入editorconfig插件,请使用eclipse的同学在贡献代码前安装相关插件,IntelliJ IDEA则自带支持,无需额外安装插件。 1. 本项目可以采用两种方式接受代码贡献: - 1. 第一种就是基于[Git Flow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow)开发流程,因此在发起Pull Request的时候请选择develop分支。 - 1. 另外一种贡献代码的方式就是加入SDK Developers开发组,前提是对自己的代码足够自信就可以申请加入,加入之后可以随时直接提交代码,但要注意对所做的修改或新增的代码进行单元测试,保证提交代码没有明显问题,具体加入方式,请咨询管理员。 +  1. 第一种就是基于[Git Flow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow)开发流程,因此在发起Pull Request的时候请选择develop分支,详细步骤参考后文。 + 1. 另外一种贡献代码的方式就是加入SDK Developers开发组,前提是对自己的代码足够自信就可以申请加入,加入之后可以随时直接提交代码,但要注意对所做的修改或新增的代码进行单元测试,保证提交代码没有明显问题,具体加入方式,请咨询QQ群管理员。 + +## 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 +``` From 16e4c484f3d41045666aae1fdc365ce406535b82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Binary=EF=BC=88=E7=8F=AD=E7=BA=B3=E7=9D=BF=EF=BC=89?= Date: Tue, 8 Nov 2016 18:23:42 +0800 Subject: [PATCH 28/41] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 493b95e2..3f69044a 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Weixin Java Tools 微信公众号/企业号开发Java SDK =========== ## 开发交流方式及注意事项: -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://jq.qq.com/?_wv=1027&k=40lRskK) (由于群容量有限即将爆满,现开启付费入群模式,并不定期清理长时间不活跃人士) 1. 微信群: 因微信群已达到100人限制,故如有想加入微信群的,请入QQ群后联系管理员,提供微信号以便邀请加入; 1. 新手提问前,请先阅读此文章:http://t.cn/RV93MRB 1. 寻求帮助时需贴代码或大长串异常信息的,请利用http://paste.ubuntu.com From 283101e9d011980f2e9bf90020464d00fb4ad972 Mon Sep 17 00:00:00 2001 From: Binary Wang Date: Thu, 10 Nov 2016 11:12:23 +0800 Subject: [PATCH 29/41] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3f69044a..f41e2223 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,8 @@ Weixin Java Tools 微信公众号/企业号开发Java SDK 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/) =========== From 6b7b421daef73f256668783db187cceb6d52ed6f Mon Sep 17 00:00:00 2001 From: Binary Wang Date: Mon, 14 Nov 2016 14:29:09 +0800 Subject: [PATCH 30/41] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f41e2223..8f18c11a 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Weixin Java Tools 微信公众号/企业号开发Java SDK =========== ## 开发交流方式及注意事项: -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) (由于群容量有限即将爆满,现开启付费入群模式,并不定期清理长时间不活跃人士) 1. 微信群: 因微信群已达到100人限制,故如有想加入微信群的,请入QQ群后联系管理员,提供微信号以便邀请加入; 1. 新手提问前,请先阅读此文章:http://t.cn/RV93MRB 1. 寻求帮助时需贴代码或大长串异常信息的,请利用http://paste.ubuntu.com From 83d2996b2309bf8481e7ddb01780e34201ed6539 Mon Sep 17 00:00:00 2001 From: Binary Wang Date: Mon, 14 Nov 2016 14:32:39 +0800 Subject: [PATCH 31/41] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8f18c11a..6cfff227 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Weixin Java Tools 微信公众号/企业号开发Java SDK =========== ## 开发交流方式及注意事项: -1. QQ群:343954419 [![Join QQ Group](http://pub.idqqimg.com/wpa/images/group.png)](http://shang.qq.com/wpa/qunwpa?idkey=731dc3e7ea31ebe25376cc1a791445468612c63fd0e9e05399b088ec81fd9e15) (由于群容量有限即将爆满,现开启付费入群模式,并不定期清理长时间不活跃人士) +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. 微信群: 因微信群已达到100人限制,故如有想加入微信群的,请入QQ群后联系管理员,提供微信号以便邀请加入; 1. 新手提问前,请先阅读此文章:http://t.cn/RV93MRB 1. 寻求帮助时需贴代码或大长串异常信息的,请利用http://paste.ubuntu.com From 266f9a65cbc5470c9777f62e3c3a72967dc0b27c Mon Sep 17 00:00:00 2001 From: Binary Wang Date: Mon, 14 Nov 2016 15:08:24 +0800 Subject: [PATCH 32/41] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6cfff227..dc891227 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,8 @@ Weixin Java Tools 微信公众号/企业号开发Java SDK =========== ## 开发交流方式及注意事项: -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. 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 From df47af287d53d83229ccaa3179047f19f5adfede Mon Sep 17 00:00:00 2001 From: cty Date: Wed, 16 Nov 2016 15:05:29 +0800 Subject: [PATCH 33/41] =?UTF-8?q?=E4=BF=AE=E6=94=B9WxCpMessage=E4=B8=ADage?= =?UTF-8?q?ntId=E7=9A=84=E6=95=B0=E6=8D=AE=E7=B1=BB=E5=9E=8B,=20String->?= =?UTF-8?q?=20Integer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + .../weixin/cp/api/WxCpConfigStorage.java | 2 +- .../cp/api/WxCpInMemoryConfigStorage.java | 6 +- .../weixin/cp/api/WxCpJedisConfigStorage.java | 534 +++++++++--------- .../me/chanjar/weixin/cp/api/WxCpService.java | 20 +- .../weixin/cp/api/WxCpServiceImpl.java | 8 +- .../chanjar/weixin/cp/bean/WxCpMessage.java | 17 +- .../cp/bean/messagebuilder/BaseBuilder.java | 4 +- 8 files changed, 294 insertions(+), 298 deletions(-) diff --git a/.gitignore b/.gitignore index a2b51e4a..fbf348ae 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ test-config.xml /gradle/ *.bat /gradlew +**/build/ # OSX # Icon must end with two \r diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpConfigStorage.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpConfigStorage.java index b334b85b..eb1e57ca 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpConfigStorage.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpConfigStorage.java @@ -45,7 +45,7 @@ public interface WxCpConfigStorage { String getCorpSecret(); - String getAgentId(); + Integer getAgentId(); String getToken(); diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpInMemoryConfigStorage.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpInMemoryConfigStorage.java index fb7bacff..867dd6bb 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpInMemoryConfigStorage.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpInMemoryConfigStorage.java @@ -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; @@ -146,11 +146,11 @@ public class WxCpInMemoryConfigStorage implements WxCpConfigStorage { } @Override - public String getAgentId() { + public Integer getAgentId() { return this.agentId; } - public void setAgentId(String agentId) { + public void setAgentId(Integer agentId) { this.agentId = agentId; } diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpJedisConfigStorage.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpJedisConfigStorage.java index 5209479f..d9cfc06f 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpJedisConfigStorage.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpJedisConfigStorage.java @@ -1,267 +1,267 @@ -package me.chanjar.weixin.cp.api; - -import java.io.File; - -import me.chanjar.weixin.common.bean.WxAccessToken; -import me.chanjar.weixin.common.util.http.ApacheHttpClientBuilder; -import redis.clients.jedis.Jedis; -import redis.clients.jedis.JedisPool; - -/** - * Jedis client implementor for wechat config storage - * - * @author gaigeshen - */ -public class WxCpJedisConfigStorage implements WxCpConfigStorage { - - /* Redis keys here */ - private static final String ACCESS_TOKEN_KEY = "WX_CP_ACCESS_TOKEN"; - private static final String ACCESS_TOKEN_EXPIRES_TIME_KEY = "WX_CP_ACCESS_TOKEN_EXPIRES_TIME"; - private static final String JS_API_TICKET_KEY = "WX_CP_JS_API_TICKET"; - private static final String JS_API_TICKET_EXPIRES_TIME_KEY = "WX_CP_JS_API_TICKET_EXPIRES_TIME"; - - private volatile String corpId; - private volatile String corpSecret; - - private volatile String token; - private volatile String aesKey; - private volatile String agentId; - - private volatile String oauth2redirectUri; - - private volatile String httpProxyHost; - private volatile int httpProxyPort; - private volatile String httpProxyUsername; - private volatile String httpProxyPassword; - - private volatile File tmpDirFile; - - private volatile ApacheHttpClientBuilder apacheHttpClientBuilder; - - /* Redis clients pool */ - private final JedisPool jedisPool; - - public WxCpJedisConfigStorage(String host, int port) { - this.jedisPool = new JedisPool(host, port); - } - - /** - * - * This method will be destroy jedis pool - */ - public void destroy() { - this.jedisPool.destroy(); - } - - @Override - public String getAccessToken() { - try (Jedis jedis = this.jedisPool.getResource()) { - return jedis.get(ACCESS_TOKEN_KEY); - } - } - - @Override - public boolean isAccessTokenExpired() { - try (Jedis jedis = this.jedisPool.getResource()) { - String expiresTimeStr = jedis.get(ACCESS_TOKEN_EXPIRES_TIME_KEY); - - if (expiresTimeStr != null) { - Long expiresTime = Long.parseLong(expiresTimeStr); - return System.currentTimeMillis() > expiresTime; - } - - return true; - - } - } - - @Override - public void expireAccessToken() { - try (Jedis jedis = this.jedisPool.getResource()) { - jedis.set(ACCESS_TOKEN_EXPIRES_TIME_KEY, "0"); - } - } - - @Override - public synchronized void updateAccessToken(WxAccessToken accessToken) { - this.updateAccessToken(accessToken.getAccessToken(), accessToken.getExpiresIn()); - } - - @Override - public synchronized void updateAccessToken(String accessToken, int expiresInSeconds) { - try (Jedis jedis = this.jedisPool.getResource()) { - jedis.set(ACCESS_TOKEN_KEY, accessToken); - - jedis.set(ACCESS_TOKEN_EXPIRES_TIME_KEY, - (System.currentTimeMillis() + (expiresInSeconds - 200) * 1000L) + ""); - } - } - - @Override - public String getJsapiTicket() { - try (Jedis jedis = this.jedisPool.getResource()) { - return jedis.get(JS_API_TICKET_KEY); - } - } - - @Override - public boolean isJsapiTicketExpired() { - - try (Jedis jedis = this.jedisPool.getResource()) { - String expiresTimeStr = jedis.get(JS_API_TICKET_EXPIRES_TIME_KEY); - - if (expiresTimeStr != null) { - Long expiresTime = Long.parseLong(expiresTimeStr); - return System.currentTimeMillis() > expiresTime; - } - - return true; - - } - } - - @Override - public void expireJsapiTicket() { - try (Jedis jedis = this.jedisPool.getResource()) { - jedis.set(JS_API_TICKET_EXPIRES_TIME_KEY, "0"); - } - } - - @Override - public synchronized void updateJsapiTicket(String jsapiTicket, int expiresInSeconds) { - - try (Jedis jedis = this.jedisPool.getResource()) { - jedis.set(JS_API_TICKET_KEY, jsapiTicket); - - jedis.set(JS_API_TICKET_EXPIRES_TIME_KEY, - (System.currentTimeMillis() + (expiresInSeconds - 200) * 1000L + "")); - } - - } - - @Override - public String getCorpId() { - return this.corpId; - } - - @Override - public String getCorpSecret() { - return this.corpSecret; - } - - @Override - public String getAgentId() { - return this.agentId; - } - - @Override - public String getToken() { - return this.token; - } - - @Override - public String getAesKey() { - return this.aesKey; - } - - @Override - public long getExpiresTime() { - try (Jedis jedis = this.jedisPool.getResource()) { - String expiresTimeStr = jedis.get(ACCESS_TOKEN_EXPIRES_TIME_KEY); - - if (expiresTimeStr != null) { - Long expiresTime = Long.parseLong(expiresTimeStr); - return expiresTime; - } - - return 0L; - - } - } - - @Override - public String getOauth2redirectUri() { - return this.oauth2redirectUri; - } - - @Override - public String getHttpProxyHost() { - return this.httpProxyHost; - } - - @Override - public int getHttpProxyPort() { - return this.httpProxyPort; - } - - @Override - public String getHttpProxyUsername() { - return this.httpProxyUsername; - } - - @Override - public String getHttpProxyPassword() { - return this.httpProxyPassword; - } - - @Override - public File getTmpDirFile() { - return this.tmpDirFile; - } - - @Override - public ApacheHttpClientBuilder getApacheHttpClientBuilder() { - return this.apacheHttpClientBuilder; - } - - public void setCorpId(String corpId) { - this.corpId = corpId; - } - - public void setCorpSecret(String corpSecret) { - this.corpSecret = corpSecret; - } - - public void setToken(String token) { - this.token = token; - } - - public void setAesKey(String aesKey) { - this.aesKey = aesKey; - } - - public void setAgentId(String agentId) { - this.agentId = agentId; - } - - // ============================ Setters below - - public void setOauth2redirectUri(String oauth2redirectUri) { - this.oauth2redirectUri = oauth2redirectUri; - } - - public void setHttpProxyHost(String httpProxyHost) { - this.httpProxyHost = httpProxyHost; - } - - public void setHttpProxyPort(int httpProxyPort) { - this.httpProxyPort = httpProxyPort; - } - - public void setHttpProxyUsername(String httpProxyUsername) { - this.httpProxyUsername = httpProxyUsername; - } - - public void setHttpProxyPassword(String httpProxyPassword) { - this.httpProxyPassword = httpProxyPassword; - } - - public void setTmpDirFile(File tmpDirFile) { - this.tmpDirFile = tmpDirFile; - } - - public void setApacheHttpClientBuilder(ApacheHttpClientBuilder apacheHttpClientBuilder) { - this.apacheHttpClientBuilder = apacheHttpClientBuilder; - } - -} +package me.chanjar.weixin.cp.api; + +import java.io.File; + +import me.chanjar.weixin.common.bean.WxAccessToken; +import me.chanjar.weixin.common.util.http.ApacheHttpClientBuilder; +import redis.clients.jedis.Jedis; +import redis.clients.jedis.JedisPool; + +/** + * Jedis client implementor for wechat config storage + * + * @author gaigeshen + */ +public class WxCpJedisConfigStorage implements WxCpConfigStorage { + + /* Redis keys here */ + private static final String ACCESS_TOKEN_KEY = "WX_CP_ACCESS_TOKEN"; + private static final String ACCESS_TOKEN_EXPIRES_TIME_KEY = "WX_CP_ACCESS_TOKEN_EXPIRES_TIME"; + private static final String JS_API_TICKET_KEY = "WX_CP_JS_API_TICKET"; + private static final String JS_API_TICKET_EXPIRES_TIME_KEY = "WX_CP_JS_API_TICKET_EXPIRES_TIME"; + + private volatile String corpId; + private volatile String corpSecret; + + private volatile String token; + private volatile String aesKey; + private volatile Integer agentId; + + private volatile String oauth2redirectUri; + + private volatile String httpProxyHost; + private volatile int httpProxyPort; + private volatile String httpProxyUsername; + private volatile String httpProxyPassword; + + private volatile File tmpDirFile; + + private volatile ApacheHttpClientBuilder apacheHttpClientBuilder; + + /* Redis clients pool */ + private final JedisPool jedisPool; + + public WxCpJedisConfigStorage(String host, int port) { + this.jedisPool = new JedisPool(host, port); + } + + /** + * + * This method will be destroy jedis pool + */ + public void destroy() { + this.jedisPool.destroy(); + } + + @Override + public String getAccessToken() { + try (Jedis jedis = this.jedisPool.getResource()) { + return jedis.get(ACCESS_TOKEN_KEY); + } + } + + @Override + public boolean isAccessTokenExpired() { + try (Jedis jedis = this.jedisPool.getResource()) { + String expiresTimeStr = jedis.get(ACCESS_TOKEN_EXPIRES_TIME_KEY); + + if (expiresTimeStr != null) { + Long expiresTime = Long.parseLong(expiresTimeStr); + return System.currentTimeMillis() > expiresTime; + } + + return true; + + } + } + + @Override + public void expireAccessToken() { + try (Jedis jedis = this.jedisPool.getResource()) { + jedis.set(ACCESS_TOKEN_EXPIRES_TIME_KEY, "0"); + } + } + + @Override + public synchronized void updateAccessToken(WxAccessToken accessToken) { + this.updateAccessToken(accessToken.getAccessToken(), accessToken.getExpiresIn()); + } + + @Override + public synchronized void updateAccessToken(String accessToken, int expiresInSeconds) { + try (Jedis jedis = this.jedisPool.getResource()) { + jedis.set(ACCESS_TOKEN_KEY, accessToken); + + jedis.set(ACCESS_TOKEN_EXPIRES_TIME_KEY, + (System.currentTimeMillis() + (expiresInSeconds - 200) * 1000L) + ""); + } + } + + @Override + public String getJsapiTicket() { + try (Jedis jedis = this.jedisPool.getResource()) { + return jedis.get(JS_API_TICKET_KEY); + } + } + + @Override + public boolean isJsapiTicketExpired() { + + try (Jedis jedis = this.jedisPool.getResource()) { + String expiresTimeStr = jedis.get(JS_API_TICKET_EXPIRES_TIME_KEY); + + if (expiresTimeStr != null) { + Long expiresTime = Long.parseLong(expiresTimeStr); + return System.currentTimeMillis() > expiresTime; + } + + return true; + + } + } + + @Override + public void expireJsapiTicket() { + try (Jedis jedis = this.jedisPool.getResource()) { + jedis.set(JS_API_TICKET_EXPIRES_TIME_KEY, "0"); + } + } + + @Override + public synchronized void updateJsapiTicket(String jsapiTicket, int expiresInSeconds) { + + try (Jedis jedis = this.jedisPool.getResource()) { + jedis.set(JS_API_TICKET_KEY, jsapiTicket); + + jedis.set(JS_API_TICKET_EXPIRES_TIME_KEY, + (System.currentTimeMillis() + (expiresInSeconds - 200) * 1000L + "")); + } + + } + + @Override + public String getCorpId() { + return this.corpId; + } + + @Override + public String getCorpSecret() { + return this.corpSecret; + } + + @Override + public Integer getAgentId() { + return this.agentId; + } + + @Override + public String getToken() { + return this.token; + } + + @Override + public String getAesKey() { + return this.aesKey; + } + + @Override + public long getExpiresTime() { + try (Jedis jedis = this.jedisPool.getResource()) { + String expiresTimeStr = jedis.get(ACCESS_TOKEN_EXPIRES_TIME_KEY); + + if (expiresTimeStr != null) { + Long expiresTime = Long.parseLong(expiresTimeStr); + return expiresTime; + } + + return 0L; + + } + } + + @Override + public String getOauth2redirectUri() { + return this.oauth2redirectUri; + } + + @Override + public String getHttpProxyHost() { + return this.httpProxyHost; + } + + @Override + public int getHttpProxyPort() { + return this.httpProxyPort; + } + + @Override + public String getHttpProxyUsername() { + return this.httpProxyUsername; + } + + @Override + public String getHttpProxyPassword() { + return this.httpProxyPassword; + } + + @Override + public File getTmpDirFile() { + return this.tmpDirFile; + } + + @Override + public ApacheHttpClientBuilder getApacheHttpClientBuilder() { + return this.apacheHttpClientBuilder; + } + + public void setCorpId(String corpId) { + this.corpId = corpId; + } + + public void setCorpSecret(String corpSecret) { + this.corpSecret = corpSecret; + } + + public void setToken(String token) { + this.token = token; + } + + public void setAesKey(String aesKey) { + this.aesKey = aesKey; + } + + public void setAgentId(Integer agentId) { + this.agentId = agentId; + } + + // ============================ Setters below + + public void setOauth2redirectUri(String oauth2redirectUri) { + this.oauth2redirectUri = oauth2redirectUri; + } + + public void setHttpProxyHost(String httpProxyHost) { + this.httpProxyHost = httpProxyHost; + } + + public void setHttpProxyPort(int httpProxyPort) { + this.httpProxyPort = httpProxyPort; + } + + public void setHttpProxyUsername(String httpProxyUsername) { + this.httpProxyUsername = httpProxyUsername; + } + + public void setHttpProxyPassword(String httpProxyPassword) { + this.httpProxyPassword = httpProxyPassword; + } + + public void setTmpDirFile(File tmpDirFile) { + this.tmpDirFile = tmpDirFile; + } + + public void setApacheHttpClientBuilder(ApacheHttpClientBuilder apacheHttpClientBuilder) { + this.apacheHttpClientBuilder = apacheHttpClientBuilder; + } + +} diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpService.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpService.java index e6f8f2ad..b5bf50c9 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpService.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpService.java @@ -160,7 +160,7 @@ public interface WxCpService { * * @param menu * @throws WxErrorException - * @see #menuCreate(String, me.chanjar.weixin.common.bean.menu.WxMenu) + * @see #menuCreate(Integer, WxMenu) */ void menuCreate(WxMenu menu) throws WxErrorException; @@ -177,7 +177,7 @@ public interface WxCpService { * @throws WxErrorException * @see #menuCreate(me.chanjar.weixin.common.bean.menu.WxMenu) */ - void menuCreate(String agentId, WxMenu menu) throws WxErrorException; + void menuCreate(Integer agentId, WxMenu menu) throws WxErrorException; /** *
@@ -188,7 +188,7 @@ public interface WxCpService {
    * 
* * @throws WxErrorException - * @see #menuDelete(String) + * @see #menuDelete(Integer) */ void menuDelete() throws WxErrorException; @@ -204,7 +204,7 @@ public interface WxCpService { * @throws WxErrorException * @see #menuDelete() */ - void menuDelete(String agentId) throws WxErrorException; + void menuDelete(Integer agentId) throws WxErrorException; /** *
@@ -215,7 +215,7 @@ public interface WxCpService {
    * 
* * @throws WxErrorException - * @see #menuGet(String) + * @see #menuGet(Integer) */ WxMenu menuGet() throws WxErrorException; @@ -231,7 +231,7 @@ public interface WxCpService { * @throws WxErrorException * @see #menuGet() */ - WxMenu menuGet(String agentId) throws WxErrorException; + WxMenu menuGet(Integer agentId) throws WxErrorException; /** *
@@ -396,12 +396,12 @@ public interface WxCpService {
    *  
    * 构造oauth2授权的url连接
    * 
- * + * * @param state * @return url */ String oauth2buildAuthorizationUrl(String state); - + /** *
    * 构造oauth2授权的url连接
@@ -425,7 +425,7 @@ public interface WxCpService {
    *
    * @param code
    * @return [userid, deviceid]
-   * @see #oauth2getUserInfo(String, String)
+   * @see #oauth2getUserInfo(Integer, String)
    */
   String[] oauth2getUserInfo(String code) throws WxErrorException;
 
@@ -443,7 +443,7 @@ public interface WxCpService {
    * @return [userid, deviceid]
    * @see #oauth2getUserInfo(String)
    */
-  String[] oauth2getUserInfo(String agentId, String code) throws WxErrorException;
+  String[] oauth2getUserInfo(Integer agentId, String code) throws WxErrorException;
 
 
   /**
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpServiceImpl.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpServiceImpl.java
index b044b468..30f9914c 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpServiceImpl.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpServiceImpl.java
@@ -191,7 +191,7 @@ public class WxCpServiceImpl implements WxCpService {
   }
 
   @Override
-  public void menuCreate(String agentId, WxMenu menu) throws WxErrorException {
+  public void menuCreate(Integer agentId, WxMenu menu) throws WxErrorException {
     String url = "https://qyapi.weixin.qq.com/cgi-bin/menu/create?agentid="
  + this.configStorage.getAgentId();
     post(url, menu.toJson());
@@ -203,7 +203,7 @@ public class WxCpServiceImpl implements WxCpService {
   }
 
   @Override
-  public void menuDelete(String agentId) throws WxErrorException {
+  public void menuDelete(Integer agentId) throws WxErrorException {
     String url = "https://qyapi.weixin.qq.com/cgi-bin/menu/delete?agentid=" + agentId;
     get(url, null);
   }
@@ -214,7 +214,7 @@ public class WxCpServiceImpl implements WxCpService {
   }
 
   @Override
-  public WxMenu menuGet(String agentId) throws WxErrorException {
+  public WxMenu menuGet(Integer agentId) throws WxErrorException {
     String url = "https://qyapi.weixin.qq.com/cgi-bin/menu/get?agentid=" + agentId;
     try {
       String resultContent = get(url, null);
@@ -487,7 +487,7 @@ this.configStorage.getOauth2redirectUri(),
   }
 
   @Override
-  public String[] oauth2getUserInfo(String agentId, String code) throws WxErrorException {
+  public String[] oauth2getUserInfo(Integer agentId, String code) throws WxErrorException {
     String url = "https://qyapi.weixin.qq.com/cgi-bin/user/getuserinfo?"
             + "code=" + code
             + "&agentid=" + agentId;
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpMessage.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpMessage.java
index e2422e3b..c25c170b 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpMessage.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpMessage.java
@@ -1,17 +1,12 @@
 package me.chanjar.weixin.cp.bean;
 
+import me.chanjar.weixin.cp.bean.messagebuilder.*;
+import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
+
 import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.List;
 
-import me.chanjar.weixin.cp.bean.messagebuilder.FileBuilder;
-import me.chanjar.weixin.cp.bean.messagebuilder.ImageBuilder;
-import me.chanjar.weixin.cp.bean.messagebuilder.NewsBuilder;
-import me.chanjar.weixin.cp.bean.messagebuilder.TextBuilder;
-import me.chanjar.weixin.cp.bean.messagebuilder.VideoBuilder;
-import me.chanjar.weixin.cp.bean.messagebuilder.VoiceBuilder;
-import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
-
 /**
  * 消息
  *
@@ -23,7 +18,7 @@ public class WxCpMessage implements Serializable {
   private String toUser;
   private String toParty;
   private String toTag;
-  private String agentId;
+  private Integer agentId;
   private String msgType;
   private String content;
   private String mediaId;
@@ -101,11 +96,11 @@ public class WxCpMessage implements Serializable {
     this.toTag = toTag;
   }
 
-  public String getAgentId() {
+  public Integer getAgentId() {
     return this.agentId;
   }
 
-  public void setAgentId(String agentId) {
+  public void setAgentId(Integer agentId) {
     this.agentId = agentId;
   }
 
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/messagebuilder/BaseBuilder.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/messagebuilder/BaseBuilder.java
index 035777d8..7800f1c6 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/messagebuilder/BaseBuilder.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/messagebuilder/BaseBuilder.java
@@ -5,13 +5,13 @@ import me.chanjar.weixin.cp.bean.WxCpMessage;
 
 public class BaseBuilder {
   protected String msgType;
-  protected String agentId;
+  protected Integer agentId;
   protected String toUser;
   protected String toParty;
   protected String toTag;
   protected String safe;
 
-  public T agentId(String agentId) {
+  public T agentId(Integer agentId) {
     this.agentId = agentId;
     return (T) this;
   }

From 3640f0d72a669f556c0e6b1260d549dd1fdf132d Mon Sep 17 00:00:00 2001
From: Binary Wang 
Date: Wed, 16 Nov 2016 15:21:14 +0800
Subject: [PATCH 34/41] =?UTF-8?q?Revert=20"=E4=BF=AE=E6=94=B9WxCpMessage?=
 =?UTF-8?q?=E4=B8=ADagentId=E7=9A=84=E6=95=B0=E6=8D=AE=E7=B1=BB=E5=9E=8B,?=
 =?UTF-8?q?=20String->=20Integer"?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .gitignore                                    |   1 -
 .../weixin/cp/api/WxCpConfigStorage.java      |   2 +-
 .../cp/api/WxCpInMemoryConfigStorage.java     |   6 +-
 .../weixin/cp/api/WxCpJedisConfigStorage.java | 534 +++++++++---------
 .../me/chanjar/weixin/cp/api/WxCpService.java |  20 +-
 .../weixin/cp/api/WxCpServiceImpl.java        |   8 +-
 .../chanjar/weixin/cp/bean/WxCpMessage.java   |  17 +-
 .../cp/bean/messagebuilder/BaseBuilder.java   |   4 +-
 8 files changed, 298 insertions(+), 294 deletions(-)

diff --git a/.gitignore b/.gitignore
index fbf348ae..a2b51e4a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -26,7 +26,6 @@ test-config.xml
 /gradle/
 *.bat
 /gradlew
-**/build/
 
 # OSX
 # Icon must end with two \r
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpConfigStorage.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpConfigStorage.java
index eb1e57ca..b334b85b 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpConfigStorage.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpConfigStorage.java
@@ -45,7 +45,7 @@ public interface WxCpConfigStorage {
 
   String getCorpSecret();
 
-  Integer getAgentId();
+  String getAgentId();
 
   String getToken();
 
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpInMemoryConfigStorage.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpInMemoryConfigStorage.java
index 867dd6bb..fb7bacff 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpInMemoryConfigStorage.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpInMemoryConfigStorage.java
@@ -19,7 +19,7 @@ public class WxCpInMemoryConfigStorage implements WxCpConfigStorage {
   protected volatile String token;
   protected volatile String accessToken;
   protected volatile String aesKey;
-  protected volatile Integer agentId;
+  protected volatile String agentId;
   protected volatile long expiresTime;
 
   protected volatile String oauth2redirectUri;
@@ -146,11 +146,11 @@ public class WxCpInMemoryConfigStorage implements WxCpConfigStorage {
   }
 
   @Override
-  public Integer getAgentId() {
+  public String getAgentId() {
     return this.agentId;
   }
 
-  public void setAgentId(Integer agentId) {
+  public void setAgentId(String agentId) {
     this.agentId = agentId;
   }
 
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpJedisConfigStorage.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpJedisConfigStorage.java
index d9cfc06f..5209479f 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpJedisConfigStorage.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpJedisConfigStorage.java
@@ -1,267 +1,267 @@
-package me.chanjar.weixin.cp.api;
-
-import java.io.File;
-
-import me.chanjar.weixin.common.bean.WxAccessToken;
-import me.chanjar.weixin.common.util.http.ApacheHttpClientBuilder;
-import redis.clients.jedis.Jedis;
-import redis.clients.jedis.JedisPool;
-
-/**
- * Jedis client implementor for wechat config storage
- *
- * @author gaigeshen
- */
-public class WxCpJedisConfigStorage implements WxCpConfigStorage {
-
-	/* Redis keys here */
-	private static final String ACCESS_TOKEN_KEY = "WX_CP_ACCESS_TOKEN";
-	private static final String ACCESS_TOKEN_EXPIRES_TIME_KEY = "WX_CP_ACCESS_TOKEN_EXPIRES_TIME";
-	private static final String JS_API_TICKET_KEY = "WX_CP_JS_API_TICKET";
-	private static final String JS_API_TICKET_EXPIRES_TIME_KEY = "WX_CP_JS_API_TICKET_EXPIRES_TIME";
-
-	private volatile String corpId;
-	private volatile String corpSecret;
-
-	private volatile String token;
-	private volatile String aesKey;
-	private volatile Integer agentId;
-
-	private volatile String oauth2redirectUri;
-
-	private volatile String httpProxyHost;
-	private volatile int httpProxyPort;
-	private volatile String httpProxyUsername;
-	private volatile String httpProxyPassword;
-
-	private volatile File tmpDirFile;
-
-	private volatile ApacheHttpClientBuilder apacheHttpClientBuilder;
-
-	/* Redis clients pool */
-	private final JedisPool jedisPool;
-
-	public WxCpJedisConfigStorage(String host, int port) {
-		this.jedisPool = new JedisPool(host, port);
-	}
-
-	/**
-	 *
-	 * This method will be destroy jedis pool
-	 */
-	public void destroy() {
-		this.jedisPool.destroy();
-	}
-
-	@Override
-	public String getAccessToken() {
-		try (Jedis jedis = this.jedisPool.getResource()) {
-			return jedis.get(ACCESS_TOKEN_KEY);
-		}
-	}
-
-	@Override
-	public boolean isAccessTokenExpired() {
-		try (Jedis jedis = this.jedisPool.getResource()) {
-			String expiresTimeStr = jedis.get(ACCESS_TOKEN_EXPIRES_TIME_KEY);
-
-			if (expiresTimeStr != null) {
-				Long expiresTime = Long.parseLong(expiresTimeStr);
-				return System.currentTimeMillis() > expiresTime;
-			}
-
-			return true;
-
-		}
-	}
-
-	@Override
-	public void expireAccessToken() {
-		try (Jedis jedis = this.jedisPool.getResource()) {
-		  jedis.set(ACCESS_TOKEN_EXPIRES_TIME_KEY, "0");
-		}
-	}
-
-	@Override
-	public synchronized void updateAccessToken(WxAccessToken accessToken) {
-		this.updateAccessToken(accessToken.getAccessToken(), accessToken.getExpiresIn());
-	}
-
-	@Override
-	public synchronized void updateAccessToken(String accessToken, int expiresInSeconds) {
-		try (Jedis jedis = this.jedisPool.getResource()) {
-			jedis.set(ACCESS_TOKEN_KEY, accessToken);
-
-			jedis.set(ACCESS_TOKEN_EXPIRES_TIME_KEY,
-					(System.currentTimeMillis() + (expiresInSeconds - 200) * 1000L) + "");
-		}
-	}
-
-	@Override
-	public String getJsapiTicket() {
-		try (Jedis jedis = this.jedisPool.getResource()) {
-		  return jedis.get(JS_API_TICKET_KEY);
-		}
-	}
-
-	@Override
-	public boolean isJsapiTicketExpired() {
-
-		try (Jedis jedis = this.jedisPool.getResource()) {
-			String expiresTimeStr = jedis.get(JS_API_TICKET_EXPIRES_TIME_KEY);
-
-			if (expiresTimeStr != null) {
-				Long expiresTime = Long.parseLong(expiresTimeStr);
-				return System.currentTimeMillis() > expiresTime;
-			}
-
-			return true;
-
-		}
-	}
-
-	@Override
-	public void expireJsapiTicket() {
-		try (Jedis jedis = this.jedisPool.getResource()) {
-			jedis.set(JS_API_TICKET_EXPIRES_TIME_KEY, "0");
-		}
-	}
-
-	@Override
-	public synchronized void updateJsapiTicket(String jsapiTicket, int expiresInSeconds) {
-
-		try (Jedis jedis = this.jedisPool.getResource()) {
-			jedis.set(JS_API_TICKET_KEY, jsapiTicket);
-
-			jedis.set(JS_API_TICKET_EXPIRES_TIME_KEY,
-					(System.currentTimeMillis() + (expiresInSeconds - 200) * 1000L + ""));
-		}
-
-	}
-
-	@Override
-	public String getCorpId() {
-		return this.corpId;
-	}
-
-	@Override
-	public String getCorpSecret() {
-		return this.corpSecret;
-	}
-
-	@Override
-	public Integer getAgentId() {
-		return this.agentId;
-	}
-
-	@Override
-	public String getToken() {
-		return this.token;
-	}
-
-	@Override
-	public String getAesKey() {
-		return this.aesKey;
-	}
-
-	@Override
-	public long getExpiresTime() {
-		try (Jedis jedis = this.jedisPool.getResource()) {
-			String expiresTimeStr = jedis.get(ACCESS_TOKEN_EXPIRES_TIME_KEY);
-
-			if (expiresTimeStr != null) {
-				Long expiresTime = Long.parseLong(expiresTimeStr);
-				return expiresTime;
-			}
-
-			return 0L;
-
-		}
-	}
-
-	@Override
-	public String getOauth2redirectUri() {
-		return this.oauth2redirectUri;
-	}
-
-	@Override
-	public String getHttpProxyHost() {
-		return this.httpProxyHost;
-	}
-
-	@Override
-	public int getHttpProxyPort() {
-		return this.httpProxyPort;
-	}
-
-	@Override
-	public String getHttpProxyUsername() {
-		return this.httpProxyUsername;
-	}
-
-	@Override
-	public String getHttpProxyPassword() {
-		return this.httpProxyPassword;
-	}
-
-	@Override
-	public File getTmpDirFile() {
-		return this.tmpDirFile;
-	}
-
-	@Override
-	public ApacheHttpClientBuilder getApacheHttpClientBuilder() {
-		return this.apacheHttpClientBuilder;
-	}
-
-	public void setCorpId(String corpId) {
-		this.corpId = corpId;
-	}
-
-	public void setCorpSecret(String corpSecret) {
-		this.corpSecret = corpSecret;
-	}
-
-	public void setToken(String token) {
-		this.token = token;
-	}
-
-	public void setAesKey(String aesKey) {
-		this.aesKey = aesKey;
-	}
-
-	public void setAgentId(Integer agentId) {
-		this.agentId = agentId;
-	}
-
-	// ============================ Setters below
-
-	public void setOauth2redirectUri(String oauth2redirectUri) {
-		this.oauth2redirectUri = oauth2redirectUri;
-	}
-
-	public void setHttpProxyHost(String httpProxyHost) {
-		this.httpProxyHost = httpProxyHost;
-	}
-
-	public void setHttpProxyPort(int httpProxyPort) {
-		this.httpProxyPort = httpProxyPort;
-	}
-
-	public void setHttpProxyUsername(String httpProxyUsername) {
-		this.httpProxyUsername = httpProxyUsername;
-	}
-
-	public void setHttpProxyPassword(String httpProxyPassword) {
-		this.httpProxyPassword = httpProxyPassword;
-	}
-
-	public void setTmpDirFile(File tmpDirFile) {
-		this.tmpDirFile = tmpDirFile;
-	}
-
-	public void setApacheHttpClientBuilder(ApacheHttpClientBuilder apacheHttpClientBuilder) {
-		this.apacheHttpClientBuilder = apacheHttpClientBuilder;
-	}
-
-}
+package me.chanjar.weixin.cp.api;
+
+import java.io.File;
+
+import me.chanjar.weixin.common.bean.WxAccessToken;
+import me.chanjar.weixin.common.util.http.ApacheHttpClientBuilder;
+import redis.clients.jedis.Jedis;
+import redis.clients.jedis.JedisPool;
+
+/**
+ * Jedis client implementor for wechat config storage
+ *
+ * @author gaigeshen
+ */
+public class WxCpJedisConfigStorage implements WxCpConfigStorage {
+
+	/* Redis keys here */
+	private static final String ACCESS_TOKEN_KEY = "WX_CP_ACCESS_TOKEN";
+	private static final String ACCESS_TOKEN_EXPIRES_TIME_KEY = "WX_CP_ACCESS_TOKEN_EXPIRES_TIME";
+	private static final String JS_API_TICKET_KEY = "WX_CP_JS_API_TICKET";
+	private static final String JS_API_TICKET_EXPIRES_TIME_KEY = "WX_CP_JS_API_TICKET_EXPIRES_TIME";
+
+	private volatile String corpId;
+	private volatile String corpSecret;
+
+	private volatile String token;
+	private volatile String aesKey;
+	private volatile String agentId;
+
+	private volatile String oauth2redirectUri;
+
+	private volatile String httpProxyHost;
+	private volatile int httpProxyPort;
+	private volatile String httpProxyUsername;
+	private volatile String httpProxyPassword;
+
+	private volatile File tmpDirFile;
+
+	private volatile ApacheHttpClientBuilder apacheHttpClientBuilder;
+
+	/* Redis clients pool */
+	private final JedisPool jedisPool;
+
+	public WxCpJedisConfigStorage(String host, int port) {
+		this.jedisPool = new JedisPool(host, port);
+	}
+
+	/**
+	 *
+	 * This method will be destroy jedis pool
+	 */
+	public void destroy() {
+		this.jedisPool.destroy();
+	}
+
+	@Override
+	public String getAccessToken() {
+		try (Jedis jedis = this.jedisPool.getResource()) {
+			return jedis.get(ACCESS_TOKEN_KEY);
+		}
+	}
+
+	@Override
+	public boolean isAccessTokenExpired() {
+		try (Jedis jedis = this.jedisPool.getResource()) {
+			String expiresTimeStr = jedis.get(ACCESS_TOKEN_EXPIRES_TIME_KEY);
+
+			if (expiresTimeStr != null) {
+				Long expiresTime = Long.parseLong(expiresTimeStr);
+				return System.currentTimeMillis() > expiresTime;
+			}
+
+			return true;
+
+		}
+	}
+
+	@Override
+	public void expireAccessToken() {
+		try (Jedis jedis = this.jedisPool.getResource()) {
+		  jedis.set(ACCESS_TOKEN_EXPIRES_TIME_KEY, "0");
+		}
+	}
+
+	@Override
+	public synchronized void updateAccessToken(WxAccessToken accessToken) {
+		this.updateAccessToken(accessToken.getAccessToken(), accessToken.getExpiresIn());
+	}
+
+	@Override
+	public synchronized void updateAccessToken(String accessToken, int expiresInSeconds) {
+		try (Jedis jedis = this.jedisPool.getResource()) {
+			jedis.set(ACCESS_TOKEN_KEY, accessToken);
+
+			jedis.set(ACCESS_TOKEN_EXPIRES_TIME_KEY,
+					(System.currentTimeMillis() + (expiresInSeconds - 200) * 1000L) + "");
+		}
+	}
+
+	@Override
+	public String getJsapiTicket() {
+		try (Jedis jedis = this.jedisPool.getResource()) {
+		  return jedis.get(JS_API_TICKET_KEY);
+		}
+	}
+
+	@Override
+	public boolean isJsapiTicketExpired() {
+
+		try (Jedis jedis = this.jedisPool.getResource()) {
+			String expiresTimeStr = jedis.get(JS_API_TICKET_EXPIRES_TIME_KEY);
+
+			if (expiresTimeStr != null) {
+				Long expiresTime = Long.parseLong(expiresTimeStr);
+				return System.currentTimeMillis() > expiresTime;
+			}
+
+			return true;
+
+		}
+	}
+
+	@Override
+	public void expireJsapiTicket() {
+		try (Jedis jedis = this.jedisPool.getResource()) {
+			jedis.set(JS_API_TICKET_EXPIRES_TIME_KEY, "0");
+		}
+	}
+
+	@Override
+	public synchronized void updateJsapiTicket(String jsapiTicket, int expiresInSeconds) {
+
+		try (Jedis jedis = this.jedisPool.getResource()) {
+			jedis.set(JS_API_TICKET_KEY, jsapiTicket);
+
+			jedis.set(JS_API_TICKET_EXPIRES_TIME_KEY,
+					(System.currentTimeMillis() + (expiresInSeconds - 200) * 1000L + ""));
+		}
+
+	}
+
+	@Override
+	public String getCorpId() {
+		return this.corpId;
+	}
+
+	@Override
+	public String getCorpSecret() {
+		return this.corpSecret;
+	}
+
+	@Override
+	public String getAgentId() {
+		return this.agentId;
+	}
+
+	@Override
+	public String getToken() {
+		return this.token;
+	}
+
+	@Override
+	public String getAesKey() {
+		return this.aesKey;
+	}
+
+	@Override
+	public long getExpiresTime() {
+		try (Jedis jedis = this.jedisPool.getResource()) {
+			String expiresTimeStr = jedis.get(ACCESS_TOKEN_EXPIRES_TIME_KEY);
+
+			if (expiresTimeStr != null) {
+				Long expiresTime = Long.parseLong(expiresTimeStr);
+				return expiresTime;
+			}
+
+			return 0L;
+
+		}
+	}
+
+	@Override
+	public String getOauth2redirectUri() {
+		return this.oauth2redirectUri;
+	}
+
+	@Override
+	public String getHttpProxyHost() {
+		return this.httpProxyHost;
+	}
+
+	@Override
+	public int getHttpProxyPort() {
+		return this.httpProxyPort;
+	}
+
+	@Override
+	public String getHttpProxyUsername() {
+		return this.httpProxyUsername;
+	}
+
+	@Override
+	public String getHttpProxyPassword() {
+		return this.httpProxyPassword;
+	}
+
+	@Override
+	public File getTmpDirFile() {
+		return this.tmpDirFile;
+	}
+
+	@Override
+	public ApacheHttpClientBuilder getApacheHttpClientBuilder() {
+		return this.apacheHttpClientBuilder;
+	}
+
+	public void setCorpId(String corpId) {
+		this.corpId = corpId;
+	}
+
+	public void setCorpSecret(String corpSecret) {
+		this.corpSecret = corpSecret;
+	}
+
+	public void setToken(String token) {
+		this.token = token;
+	}
+
+	public void setAesKey(String aesKey) {
+		this.aesKey = aesKey;
+	}
+
+	public void setAgentId(String agentId) {
+		this.agentId = agentId;
+	}
+
+	// ============================ Setters below
+
+	public void setOauth2redirectUri(String oauth2redirectUri) {
+		this.oauth2redirectUri = oauth2redirectUri;
+	}
+
+	public void setHttpProxyHost(String httpProxyHost) {
+		this.httpProxyHost = httpProxyHost;
+	}
+
+	public void setHttpProxyPort(int httpProxyPort) {
+		this.httpProxyPort = httpProxyPort;
+	}
+
+	public void setHttpProxyUsername(String httpProxyUsername) {
+		this.httpProxyUsername = httpProxyUsername;
+	}
+
+	public void setHttpProxyPassword(String httpProxyPassword) {
+		this.httpProxyPassword = httpProxyPassword;
+	}
+
+	public void setTmpDirFile(File tmpDirFile) {
+		this.tmpDirFile = tmpDirFile;
+	}
+
+	public void setApacheHttpClientBuilder(ApacheHttpClientBuilder apacheHttpClientBuilder) {
+		this.apacheHttpClientBuilder = apacheHttpClientBuilder;
+	}
+
+}
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpService.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpService.java
index b5bf50c9..e6f8f2ad 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpService.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpService.java
@@ -160,7 +160,7 @@ public interface WxCpService {
    *
    * @param menu
    * @throws WxErrorException
-   * @see #menuCreate(Integer, WxMenu)
+   * @see #menuCreate(String, me.chanjar.weixin.common.bean.menu.WxMenu)
    */
   void menuCreate(WxMenu menu) throws WxErrorException;
 
@@ -177,7 +177,7 @@ public interface WxCpService {
    * @throws WxErrorException
    * @see #menuCreate(me.chanjar.weixin.common.bean.menu.WxMenu)
    */
-  void menuCreate(Integer agentId, WxMenu menu) throws WxErrorException;
+  void menuCreate(String agentId, WxMenu menu) throws WxErrorException;
 
   /**
    * 
@@ -188,7 +188,7 @@ public interface WxCpService {
    * 
* * @throws WxErrorException - * @see #menuDelete(Integer) + * @see #menuDelete(String) */ void menuDelete() throws WxErrorException; @@ -204,7 +204,7 @@ public interface WxCpService { * @throws WxErrorException * @see #menuDelete() */ - void menuDelete(Integer agentId) throws WxErrorException; + void menuDelete(String agentId) throws WxErrorException; /** *
@@ -215,7 +215,7 @@ public interface WxCpService {
    * 
* * @throws WxErrorException - * @see #menuGet(Integer) + * @see #menuGet(String) */ WxMenu menuGet() throws WxErrorException; @@ -231,7 +231,7 @@ public interface WxCpService { * @throws WxErrorException * @see #menuGet() */ - WxMenu menuGet(Integer agentId) throws WxErrorException; + WxMenu menuGet(String agentId) throws WxErrorException; /** *
@@ -396,12 +396,12 @@ public interface WxCpService {
    *  
    * 构造oauth2授权的url连接
    * 
- * + * * @param state * @return url */ String oauth2buildAuthorizationUrl(String state); - + /** *
    * 构造oauth2授权的url连接
@@ -425,7 +425,7 @@ public interface WxCpService {
    *
    * @param code
    * @return [userid, deviceid]
-   * @see #oauth2getUserInfo(Integer, String)
+   * @see #oauth2getUserInfo(String, String)
    */
   String[] oauth2getUserInfo(String code) throws WxErrorException;
 
@@ -443,7 +443,7 @@ public interface WxCpService {
    * @return [userid, deviceid]
    * @see #oauth2getUserInfo(String)
    */
-  String[] oauth2getUserInfo(Integer agentId, String code) throws WxErrorException;
+  String[] oauth2getUserInfo(String agentId, String code) throws WxErrorException;
 
 
   /**
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpServiceImpl.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpServiceImpl.java
index 30f9914c..b044b468 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpServiceImpl.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpServiceImpl.java
@@ -191,7 +191,7 @@ public class WxCpServiceImpl implements WxCpService {
   }
 
   @Override
-  public void menuCreate(Integer agentId, WxMenu menu) throws WxErrorException {
+  public void menuCreate(String agentId, WxMenu menu) throws WxErrorException {
     String url = "https://qyapi.weixin.qq.com/cgi-bin/menu/create?agentid="
  + this.configStorage.getAgentId();
     post(url, menu.toJson());
@@ -203,7 +203,7 @@ public class WxCpServiceImpl implements WxCpService {
   }
 
   @Override
-  public void menuDelete(Integer agentId) throws WxErrorException {
+  public void menuDelete(String agentId) throws WxErrorException {
     String url = "https://qyapi.weixin.qq.com/cgi-bin/menu/delete?agentid=" + agentId;
     get(url, null);
   }
@@ -214,7 +214,7 @@ public class WxCpServiceImpl implements WxCpService {
   }
 
   @Override
-  public WxMenu menuGet(Integer agentId) throws WxErrorException {
+  public WxMenu menuGet(String agentId) throws WxErrorException {
     String url = "https://qyapi.weixin.qq.com/cgi-bin/menu/get?agentid=" + agentId;
     try {
       String resultContent = get(url, null);
@@ -487,7 +487,7 @@ this.configStorage.getOauth2redirectUri(),
   }
 
   @Override
-  public String[] oauth2getUserInfo(Integer agentId, String code) throws WxErrorException {
+  public String[] oauth2getUserInfo(String agentId, String code) throws WxErrorException {
     String url = "https://qyapi.weixin.qq.com/cgi-bin/user/getuserinfo?"
             + "code=" + code
             + "&agentid=" + agentId;
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpMessage.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpMessage.java
index c25c170b..e2422e3b 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpMessage.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpMessage.java
@@ -1,12 +1,17 @@
 package me.chanjar.weixin.cp.bean;
 
-import me.chanjar.weixin.cp.bean.messagebuilder.*;
-import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
-
 import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.List;
 
+import me.chanjar.weixin.cp.bean.messagebuilder.FileBuilder;
+import me.chanjar.weixin.cp.bean.messagebuilder.ImageBuilder;
+import me.chanjar.weixin.cp.bean.messagebuilder.NewsBuilder;
+import me.chanjar.weixin.cp.bean.messagebuilder.TextBuilder;
+import me.chanjar.weixin.cp.bean.messagebuilder.VideoBuilder;
+import me.chanjar.weixin.cp.bean.messagebuilder.VoiceBuilder;
+import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
+
 /**
  * 消息
  *
@@ -18,7 +23,7 @@ public class WxCpMessage implements Serializable {
   private String toUser;
   private String toParty;
   private String toTag;
-  private Integer agentId;
+  private String agentId;
   private String msgType;
   private String content;
   private String mediaId;
@@ -96,11 +101,11 @@ public class WxCpMessage implements Serializable {
     this.toTag = toTag;
   }
 
-  public Integer getAgentId() {
+  public String getAgentId() {
     return this.agentId;
   }
 
-  public void setAgentId(Integer agentId) {
+  public void setAgentId(String agentId) {
     this.agentId = agentId;
   }
 
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/messagebuilder/BaseBuilder.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/messagebuilder/BaseBuilder.java
index 7800f1c6..035777d8 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/messagebuilder/BaseBuilder.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/messagebuilder/BaseBuilder.java
@@ -5,13 +5,13 @@ import me.chanjar.weixin.cp.bean.WxCpMessage;
 
 public class BaseBuilder {
   protected String msgType;
-  protected Integer agentId;
+  protected String agentId;
   protected String toUser;
   protected String toParty;
   protected String toTag;
   protected String safe;
 
-  public T agentId(Integer agentId) {
+  public T agentId(String agentId) {
     this.agentId = agentId;
     return (T) this;
   }

From f629ccb7ca83bfc1877ee3c011deda534f79bfaa Mon Sep 17 00:00:00 2001
From: Binary Wang 
Date: Wed, 16 Nov 2016 16:29:53 +0800
Subject: [PATCH 35/41] Update README.md

---
 README.md | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

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

From 3ebf39339fce37ef817ce5de8d0a0a4a02f4ba23 Mon Sep 17 00:00:00 2001
From: Binary Wang 
Date: Wed, 16 Nov 2016 17:10:58 +0800
Subject: [PATCH 36/41] Update README.md

---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 8136cc89..8d5d1f91 100644
--- a/README.md
+++ b/README.md
@@ -83,7 +83,7 @@ compile 'com.github.binarywang:weixin-java-cp:2.3.0'
 1. 为了便于设置,本项目引入editorconfig插件,请使用eclipse的同学在贡献代码前安装相关插件,IntelliJ IDEA则自带支持,无需额外安装插件。
 1. 本项目可以采用两种方式接受代码贡献:
   1. 第一种就是基于[Git Flow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow)开发流程,因此在发起Pull Request的时候请选择develop分支,详细步骤参考后文。
-  1. 另外一种贡献代码的方式就是加入SDK Developers开发组,前提是对自己的代码足够自信就可以申请加入,加入之后可以随时直接提交代码,但要注意对所做的修改或新增的代码进行单元测试,保证提交代码没有明显问题,具体加入方式,请咨询QQ群管理员。
+  1. 另外一种贡献代码的方式就是加入SDK Developers开发组,前提是对自己的代码足够自信就可以申请加入,加入之后可以随时直接提交代码,但要注意对所做的修改或新增的代码进行单元测试,保证提交代码没有明显问题,具体加入方式,请咨询QQ群管理员点击这里给我发消息。
 
 ## PR方式贡献代码步骤
 * 在 GitHub 上 `fork` 到自己的仓库,如 `my_user/weixin-java-tools`,然后 `clone` 到本地,并设置用户信息。

From 878ebb1cb48e363e015e4ad3ac16f684e1e71df9 Mon Sep 17 00:00:00 2001
From: Binary Wang 
Date: Wed, 16 Nov 2016 17:23:48 +0800
Subject: [PATCH 37/41] Update README.md

---
 README.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index 8d5d1f91..dc7ea455 100644
--- a/README.md
+++ b/README.md
@@ -82,8 +82,8 @@ compile 'com.github.binarywang:weixin-java-cp:2.3.0'
 1. 非常欢迎和感谢对本项目发起Pull Request的同学,本项目代码风格为使用2个空格代表一个Tab,因此在提交代码时请注意一下,否则很容易在IDE格式化代码后与原代码产生大量diff,这样会给其他人阅读代码带来极大的困扰。
 1. 为了便于设置,本项目引入editorconfig插件,请使用eclipse的同学在贡献代码前安装相关插件,IntelliJ IDEA则自带支持,无需额外安装插件。
 1. 本项目可以采用两种方式接受代码贡献:
-  1. 第一种就是基于[Git Flow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow)开发流程,因此在发起Pull Request的时候请选择develop分支,详细步骤参考后文。
-  1. 另外一种贡献代码的方式就是加入SDK Developers开发组,前提是对自己的代码足够自信就可以申请加入,加入之后可以随时直接提交代码,但要注意对所做的修改或新增的代码进行单元测试,保证提交代码没有明显问题,具体加入方式,请咨询QQ群管理员点击这里给我发消息。
+  * 第一种就是基于[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)。
 
 ## PR方式贡献代码步骤
 * 在 GitHub 上 `fork` 到自己的仓库,如 `my_user/weixin-java-tools`,然后 `clone` 到本地,并设置用户信息。

From 1e3537590d9483b0d7c11f2b98194760da8f0298 Mon Sep 17 00:00:00 2001
From: Binary Wang 
Date: Thu, 17 Nov 2016 10:28:51 +0800
Subject: [PATCH 38/41] Update README.md

---
 README.md | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md
index dc7ea455..20ddc679 100644
--- a/README.md
+++ b/README.md
@@ -72,10 +72,12 @@ 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
+
 
 ===========
 ## 关于代码贡献

From 2a63e12f55edd807f4d52351ec2551c0036c4ffb Mon Sep 17 00:00:00 2001
From: Binary Wang 
Date: Thu, 17 Nov 2016 10:35:32 +0800
Subject: [PATCH 39/41] Update README.md

---
 README.md | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 20ddc679..7774fa6a 100644
--- a/README.md
+++ b/README.md
@@ -72,7 +72,8 @@ compile 'com.github.binarywang:weixin-java-cp:2.3.0'
 * https://git.coding.net/binarywang/weixin-java-tools.git
 
 ===========
-## 目前可参考的Demo项目有四个(目前都是公众号的,风格不同,欢迎提供更多的demo供新手参考):
+## 可参考的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

From 58f823faa8740bdbf38f6b104e8e0fc0ab03ef5e Mon Sep 17 00:00:00 2001
From: Binary Wang 
Date: Thu, 1 Dec 2016 09:27:55 +0800
Subject: [PATCH 40/41] Update README.md

---
 README.md | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/README.md b/README.md
index 7774fa6a..4c61f08d 100644
--- a/README.md
+++ b/README.md
@@ -7,7 +7,7 @@ Weixin Java Tools 微信公众号/企业号开发Java SDK
 1. ***本项目Fork自chanjarster/weixin-java-tools,但由于原项目已停止维护,故单独维护和发布,且发布到maven上的groupId也会不同,详细信息见下文。***
 1. ***自2.0.0版本以来,公众号的接口调整比较大,主要是为了解决主接口类过于庞大不方便管理的问题,将接口实现代码按模块进行拆分。***
 1. 本SDK要求的最低JDK版本是7,为满足少量还在使用JDK6的用户的需求,特意抽出独立的代码分支项目,请参考 https://github.com/binarywang/weixin-java-tools-for-jdk6 ,其他更早的JDK版本则需要自己改造实现;
-1. 最新更新:2016-10-31 发布2.3.0正式版!
+1. 最新更新:2016-11-30 发布2.4.0正式版!
 
 ===========
 
@@ -39,12 +39,12 @@ maven:
 
   com.github.binarywang
   weixin-java-mp
-  2.3.0
+  2.4.0
 
 ```
 gradle:
 ```groovy
-compile 'com.github.binarywang:weixin-java-mp:2.3.0'
+compile 'com.github.binarywang:weixin-java-mp:2.4.0'
 ```
 
 * 企业号:
@@ -54,12 +54,12 @@ maven:
 
   com.github.binarywang
   weixin-java-cp
-  2.3.0
+  2.4.0
 
 ```
 gradle:
 ```groovy
-compile 'com.github.binarywang:weixin-java-cp:2.3.0'
+compile 'com.github.binarywang:weixin-java-cp:2.4.0'
 ```
 
 ===========

From dd7a734e8a578cc3b4920564e1328a2f81ae05b8 Mon Sep 17 00:00:00 2001
From: Binary Wang 
Date: Thu, 1 Dec 2016 10:08:50 +0800
Subject: [PATCH 41/41] Update build.gradle

---
 build.gradle | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/build.gradle b/build.gradle
index a2858210..64785fce 100644
--- a/build.gradle
+++ b/build.gradle
@@ -2,7 +2,7 @@ allprojects  {
   apply plugin: 'maven'
 
   group = 'com.github.binarywang'
-  version = '2.4.0-SNAPSHOT'
+  version = '2.4.0'
 }
 
 subprojects {