Skip to content

Commit

Permalink
2.5.0-RELEASE
Browse files Browse the repository at this point in the history
  • Loading branch information
liyiorg committed Dec 22, 2015
1 parent fe2d76b commit cb2a8d3
Show file tree
Hide file tree
Showing 95 changed files with 2,454 additions and 370 deletions.
12 changes: 9 additions & 3 deletions .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,21 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
Expand Down
4 changes: 2 additions & 2 deletions .project
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
Expand Down
1 change: 1 addition & 0 deletions .settings/org.eclipse.core.resources.prefs
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/test/java=UTF-8
280 changes: 280 additions & 0 deletions .settings/org.eclipse.jdt.core.prefs

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ weixin-popular 包括微信公众平台基础API与支付API,提供便捷的API
* [TokenAPI](https://github.com/liyiorg/weixin-popular/wiki/TokenAPI) access_token 获取
* [MediaAPI](https://github.com/liyiorg/weixin-popular/wiki/MediaAPI) 多媒体上传下载(临时素材)
* [MaterialAPI](https://github.com/liyiorg/weixin-popular/wiki/MaterialAPI) 永久素材
* [MenuAPI](https://github.com/liyiorg/weixin-popular/wiki/MenuAPI) 菜单
* [MenuAPI](https://github.com/liyiorg/weixin-popular/wiki/MenuAPI) 菜单、个性化菜单
* [MessageAPI](https://github.com/liyiorg/weixin-popular/wiki/MessageAPI) 信息发送(客服消息、群发消息、模板消息)
* [PayAPI](https://github.com/liyiorg/weixin-popular/wiki/PayAPI) 支付订单相关接口
* [PayMchAPI](https://github.com/liyiorg/weixin-popular/wiki/PayMchAPI) 支付订单、红包、企业付款相关接口(商户平台版)
* [PayMchAPI](https://github.com/liyiorg/weixin-popular/wiki/PayMchAPI) 支付订单、红包、企业付款、代扣费(商户平台版)
* [QrcodeAPI](https://github.com/liyiorg/weixin-popular/wiki/QrcodeAPI) 二维码
* [SnsAPI](https://github.com/liyiorg/weixin-popular/wiki/SnsAPI) 网签授权
* [UserAPI](https://github.com/liyiorg/weixin-popular/wiki/UserAPI) 用户管理
Expand All @@ -40,10 +40,14 @@ weixin-popular 包括微信公众平台基础API与支付API,提供便捷的API
* [TicketManager ticket 自动刷新](https://github.com/liyiorg/weixin-popular/wiki/TicketManager-ticket-自动刷新)
* [设置API HttpClient 请求池大小](https://github.com/liyiorg/weixin-popular/wiki/设置API HttpClient 请求池大小)
* [设置API MCH KeyStore](https://github.com/liyiorg/weixin-popular/wiki/设置API MCH KeyStore)
* [排除重复的异步通知](https://github.com/liyiorg/weixin-popular/wiki/排除重复的异步通知)

## 参考资料
* [微信公众平台开发者文档](http://mp.weixin.qq.com/wiki/index.php)
* [微信商户服务中心](http://mp.weixin.qq.com/cgi-bin/readtemplate?t=business/faq_tmpl&lang=zh_CN)
* [微信支付开发教程(老版本)](https://mp.weixin.qq.com/paymch/readtemplate?t=mp/business/course2_tmpl&lang=zh_CN&token=6056275)
* [微信支付商户平台开发者文档](http://mch.weixin.qq.com/wiki/doc/api/index.html)
* [微信开放平台(公众号第三方平台开发)](https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&lang=zh_CN)

## QQ交流群
369381797
10 changes: 10 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@ WEIXIN-POPULAR CHANGELOG
===========================
https://github.com/liyiorg/weixin-popular

Changes in version 2.5.0 (2015-12-22)
-------------------------------------
*weixin.popular.bean 下的类整理分包。
*添加ExpireKey接口以及实现类,用于处理重复异步通知。
*weixin.popular.api.PayMchAPI 添加代扣费接口
*weixin.popular.api.MenuAPI 添加个性化菜单接口
*修改weixin.popular.support.TokenManager、weixin.popular.support.TicketManager 调度方式由Timer 改为 ScheduledExecutorService。
*修改支付异步通知的校验方式。
*删除weixin.popular.util.ExpireSet

Changes in version 2.4.6 (2015-11-12)
-------------------------------------
*修改XmlResponseHandler 解决微信红包接口返回结果中文乱码问题
Expand Down
16 changes: 15 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>weixin</groupId>
<artifactId>weixin-popular</artifactId>
<version>2.4.6-RELEASE</version>
<version>2.5.0-RELEASE</version>
<url>https://github.com/liyiorg/weixin-popular</url>

<dependencies>
Expand All @@ -13,6 +13,20 @@
<version>2.5</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>2.7.3</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
<version>2.3</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/weixin/popular/api/MaterialAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

import weixin.popular.bean.Article;
import weixin.popular.bean.BaseResult;
import weixin.popular.bean.Media;
import weixin.popular.bean.MediaType;
import weixin.popular.bean.material.Description;
import weixin.popular.bean.material.MaterialBatchgetResult;
import weixin.popular.bean.material.MaterialcountResult;
import weixin.popular.bean.material.NewsItem;
import weixin.popular.bean.media.Media;
import weixin.popular.bean.media.MediaType;
import weixin.popular.bean.message.Article;
import weixin.popular.client.LocalHttpClient;
import weixin.popular.util.JsonUtil;

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/weixin/popular/api/MediaAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

import weixin.popular.bean.Media;
import weixin.popular.bean.MediaType;
import weixin.popular.bean.UploadimgResult;
import weixin.popular.bean.media.Media;
import weixin.popular.bean.media.MediaType;
import weixin.popular.bean.media.UploadimgResult;
import weixin.popular.client.LocalHttpClient;

public class MediaAPI extends BaseAPI{
Expand Down
55 changes: 52 additions & 3 deletions src/main/java/weixin/popular/api/MenuAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
import org.apache.http.entity.StringEntity;

import weixin.popular.bean.BaseResult;
import weixin.popular.bean.Menu;
import weixin.popular.bean.MenuButtons;
import weixin.popular.bean.selfmenu.CurrentSelfmenuInfo;
import weixin.popular.bean.menu.Menu;
import weixin.popular.bean.menu.MenuButtons;
import weixin.popular.bean.menu.TrymatchResult;
import weixin.popular.bean.menu.selfmenu.CurrentSelfmenuInfo;
import weixin.popular.client.LocalHttpClient;
import weixin.popular.util.JsonUtil;

Expand Down Expand Up @@ -86,6 +87,54 @@ public static CurrentSelfmenuInfo get_current_selfmenu_info(String access_token)
return LocalHttpClient.executeJsonResult(httpUriRequest,CurrentSelfmenuInfo.class);
}

/**
* 创建个性化菜单
* @param access_token
* @param menuButtons
* @return
*/
public static BaseResult menuAddconditional(String access_token,MenuButtons menuButtons){
String menuJson = JsonUtil.toJSONString(menuButtons);
HttpUriRequest httpUriRequest = RequestBuilder.post()
.setHeader(jsonHeader)
.setUri(BASE_URI+"/cgi-bin/menu/addconditional")
.addParameter("access_token", access_token)
.setEntity(new StringEntity(menuJson,Charset.forName("utf-8")))
.build();
return LocalHttpClient.executeJsonResult(httpUriRequest,BaseResult.class);
}

/**
* 删除个性化菜单
* @param access_token
* @param menuid
* @return
*/
public static BaseResult menuDelconditional(String access_token,String menuid){
HttpUriRequest httpUriRequest = RequestBuilder.post()
.setHeader(jsonHeader)
.setUri(BASE_URI+"/cgi-bin/menu/delconditional")
.addParameter("access_token", access_token)
.setEntity(new StringEntity("{\"menuid\":\""+menuid+"\"}",Charset.forName("utf-8")))
.build();
return LocalHttpClient.executeJsonResult(httpUriRequest,BaseResult.class);
}

/**
* 测试个性化菜单匹配结果
* @param access_token
* @param user_id 可以是粉丝的OpenID,也可以是粉丝的微信号。
* @return
*/
public static TrymatchResult menuTrymatch(String access_token,String user_id){
HttpUriRequest httpUriRequest = RequestBuilder.post()
.setHeader(jsonHeader)
.setUri(BASE_URI+"/cgi-bin/menu/trymatch")
.addParameter("access_token", access_token)
.setEntity(new StringEntity("{\"user_id\":\""+user_id+"\"}",Charset.forName("utf-8")))
.build();
return LocalHttpClient.executeJsonResult(httpUriRequest,TrymatchResult.class);
}


}
16 changes: 8 additions & 8 deletions src/main/java/weixin/popular/api/MessageAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
import org.apache.http.client.methods.RequestBuilder;
import org.apache.http.entity.StringEntity;

import weixin.popular.bean.Article;
import weixin.popular.bean.BaseResult;
import weixin.popular.bean.Media;
import weixin.popular.bean.MessageSendResult;
import weixin.popular.bean.Uploadvideo;
import weixin.popular.bean.massmessage.MassMessage;
import weixin.popular.bean.message.Message;
import weixin.popular.bean.templatemessage.TemplateMessage;
import weixin.popular.bean.templatemessage.TemplateMessageResult;
import weixin.popular.bean.media.Media;
import weixin.popular.bean.message.Article;
import weixin.popular.bean.message.MessageSendResult;
import weixin.popular.bean.message.Uploadvideo;
import weixin.popular.bean.message.massmessage.MassMessage;
import weixin.popular.bean.message.message.Message;
import weixin.popular.bean.message.templatemessage.TemplateMessage;
import weixin.popular.bean.message.templatemessage.TemplateMessageResult;
import weixin.popular.client.LocalHttpClient;
import weixin.popular.util.JsonUtil;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/weixin/popular/api/PayAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import org.apache.http.entity.StringEntity;

import weixin.popular.bean.BaseResult;
import weixin.popular.bean.Delivernotify;
import weixin.popular.bean.pay.Delivernotify;
import weixin.popular.bean.pay.OrderInfo;
import weixin.popular.bean.pay.Orderquery;
import weixin.popular.client.LocalHttpClient;
Expand Down
Loading

0 comments on commit cb2a8d3

Please sign in to comment.