Skip to content

Commit 3757606

Browse files
author
ecoolper
committed
Merge remote-tracking branch 'remotes/wechat/develop' into develop
# Conflicts: # weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/MediaDownloadRequestExecutor.java # weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/MediaUploadRequestExecutor.java # weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/RequestExecutor.java # weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/SimpleGetRequestExecutor.java # weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/SimplePostRequestExecutor.java # weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/apache/ApacheMediaDownloadRequestExecutor.java # weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/apache/ApacheMediaUploadRequestExecutor.java # weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/apache/ApacheSimpleGetRequestExecutor.java # weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/apache/ApacheSimplePostRequestExecutor.java # weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/jodd/JoddMediaDownloadRequestExecutor.java # weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/jodd/JoddMediaUploadRequestExecutor.java # weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/jodd/JoddSimpleGetRequestExecutor.java # weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/jodd/JoddSimplePostRequestExecutor.java # weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/okhttp/OkMediaDownloadRequestExecutor.java # weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/okhttp/OkMediaUploadRequestExecutor.java # weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/okhttp/OkSimpleGetRequestExecutor.java # weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/okhttp/OkSimplePostRequestExecutor.java # weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpService.java # weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/WxMpMaterialServiceImpl.java # weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/jodd/WxMpServiceImpl.java # weixin-java-mp/src/main/java/me/chanjar/weixin/mp/util/http/MaterialDeleteRequestExecutor.java # weixin-java-mp/src/main/java/me/chanjar/weixin/mp/util/http/MaterialNewsInfoRequestExecutor.java # weixin-java-mp/src/main/java/me/chanjar/weixin/mp/util/http/MaterialUploadRequestExecutor.java # weixin-java-mp/src/main/java/me/chanjar/weixin/mp/util/http/MaterialVideoInfoRequestExecutor.java # weixin-java-mp/src/main/java/me/chanjar/weixin/mp/util/http/MaterialVoiceAndImageDownloadRequestExecutor.java # weixin-java-mp/src/main/java/me/chanjar/weixin/mp/util/http/MediaImgUploadRequestExecutor.java # weixin-java-mp/src/main/java/me/chanjar/weixin/mp/util/http/QrCodeRequestExecutor.java # weixin-java-mp/src/main/java/me/chanjar/weixin/mp/util/http/apache/ApacheMaterialDeleteRequestExecutor.java # weixin-java-mp/src/main/java/me/chanjar/weixin/mp/util/http/apache/ApacheMaterialNewsInfoRequestExecutor.java # weixin-java-mp/src/main/java/me/chanjar/weixin/mp/util/http/apache/ApacheMaterialUploadRequestExecutor.java # weixin-java-mp/src/main/java/me/chanjar/weixin/mp/util/http/apache/ApacheMaterialVideoInfoRequestExecutor.java # weixin-java-mp/src/main/java/me/chanjar/weixin/mp/util/http/apache/ApacheMaterialVoiceAndImageDownloadRequestExecutor.java # weixin-java-mp/src/main/java/me/chanjar/weixin/mp/util/http/apache/ApacheMediaImgUploadRequestExecutor.java # weixin-java-mp/src/main/java/me/chanjar/weixin/mp/util/http/apache/ApacheQrCodeRequestExecutor.java # weixin-java-mp/src/main/java/me/chanjar/weixin/mp/util/http/jodd/JoddMaterialDeleteRequestExecutor.java # weixin-java-mp/src/main/java/me/chanjar/weixin/mp/util/http/jodd/JoddMaterialNewsInfoRequestExecutor.java # weixin-java-mp/src/main/java/me/chanjar/weixin/mp/util/http/jodd/JoddMaterialUploadRequestExecutor.java # weixin-java-mp/src/main/java/me/chanjar/weixin/mp/util/http/jodd/JoddMaterialVideoInfoRequestExecutor.java # weixin-java-mp/src/main/java/me/chanjar/weixin/mp/util/http/jodd/JoddMaterialVoiceAndImageDownloadRequestExecutor.java # weixin-java-mp/src/main/java/me/chanjar/weixin/mp/util/http/jodd/JoddMediaImgUploadRequestExecutor.java # weixin-java-mp/src/main/java/me/chanjar/weixin/mp/util/http/jodd/JoddQrCodeRequestExecutor.java # weixin-java-mp/src/main/java/me/chanjar/weixin/mp/util/http/okhttp/OkhttpMaterialDeleteRequestExecutor.java # weixin-java-mp/src/main/java/me/chanjar/weixin/mp/util/http/okhttp/OkhttpMaterialNewsInfoRequestExecutor.java # weixin-java-mp/src/main/java/me/chanjar/weixin/mp/util/http/okhttp/OkhttpMaterialUploadRequestExecutor.java # weixin-java-mp/src/main/java/me/chanjar/weixin/mp/util/http/okhttp/OkhttpMaterialVideoInfoRequestExecutor.java # weixin-java-mp/src/main/java/me/chanjar/weixin/mp/util/http/okhttp/OkhttpMaterialVoiceAndImageDownloadRequestExecutor.java # weixin-java-mp/src/main/java/me/chanjar/weixin/mp/util/http/okhttp/OkhttpMediaImgUploadRequestExecutor.java # weixin-java-mp/src/main/java/me/chanjar/weixin/mp/util/http/okhttp/OkhttpQrCodeRequestExecutor.java
2 parents fcf3dbc + 1806389 commit 3757606

File tree

243 files changed

+2731
-2601
lines changed

Some content is hidden

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

243 files changed

+2731
-2601
lines changed

build.gradle

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
allprojects {
1+
allprojects {
22
apply plugin: 'maven'
33

44
group = 'com.github.binarywang'
@@ -19,15 +19,15 @@ subprojects {
1919

2020

2121
dependencies {
22-
compile group: 'org.slf4j', name: 'slf4j-api', version:'1.7.10'
23-
compile group: 'org.apache.httpcomponents', name: 'httpmime', version:'4.5'
24-
compile group: 'org.apache.httpcomponents', name: 'httpclient', version:'4.5'
25-
compile group: 'com.google.code.gson', name: 'gson', version:'2.7'
26-
compile group: 'com.google.guava', name: 'guava', version:'19.0'
27-
compile group: 'commons-codec', name: 'commons-codec', version:'1.10'
28-
compile group: 'commons-io', name: 'commons-io', version:'2.5'
29-
compile group: 'org.apache.commons', name: 'commons-lang3', version:'3.4'
30-
compile group: 'redis.clients', name: 'jedis', version:'2.9.0'
31-
testCompile group: 'ch.qos.logback', name: 'logback-classic', version:'1.1.2'
22+
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.10'
23+
compile group: 'org.apache.httpcomponents', name: 'httpmime', version: '4.5'
24+
compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5'
25+
compile group: 'com.google.code.gson', name: 'gson', version: '2.7'
26+
compile group: 'com.google.guava', name: 'guava', version: '19.0'
27+
compile group: 'commons-codec', name: 'commons-codec', version: '1.10'
28+
compile group: 'commons-io', name: 'commons-io', version: '2.5'
29+
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.4'
30+
compile group: 'redis.clients', name: 'jedis', version: '2.9.0'
31+
testCompile group: 'ch.qos.logback', name: 'logback-classic', version: '1.1.2'
3232
}
3333
}

pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<?xml version="1.0"?>
22
<project
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0">
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
5+
xmlns="http://maven.apache.org/POM/4.0.0">
56
<modelVersion>4.0.0</modelVersion>
67
<groupId>com.github.binarywang</groupId>
78
<artifactId>weixin-java-parent</artifactId>

weixin-java-common/build.gradle

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
21
description = 'WeiXin Java Tools - Common'
32
dependencies {
4-
compile group: 'com.thoughtworks.xstream', name: 'xstream', version:'1.4.7'
5-
testCompile group: 'junit', name: 'junit', version:'4.11'
6-
testCompile group: 'org.testng', name: 'testng', version:'6.8.7'
7-
testCompile group: 'org.mockito', name: 'mockito-all', version:'1.9.5'
8-
testCompile group: 'com.google.inject', name: 'guice', version:'3.0'
9-
testCompile group: 'org.eclipse.jetty', name: 'jetty-server', version:'9.3.0.RC0'
10-
testCompile group: 'org.eclipse.jetty', name: 'jetty-servlet', version:'9.3.0.RC0'
3+
compile group: 'com.thoughtworks.xstream', name: 'xstream', version: '1.4.7'
4+
testCompile group: 'junit', name: 'junit', version: '4.11'
5+
testCompile group: 'org.testng', name: 'testng', version: '6.8.7'
6+
testCompile group: 'org.mockito', name: 'mockito-all', version: '1.9.5'
7+
testCompile group: 'com.google.inject', name: 'guice', version: '3.0'
8+
testCompile group: 'org.eclipse.jetty', name: 'jetty-server', version: '9.3.0.RC0'
9+
testCompile group: 'org.eclipse.jetty', name: 'jetty-servlet', version: '9.3.0.RC0'
1110
}
1211
test.useTestNG()

weixin-java-common/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0"?>
22
<project
3-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
4-
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0">
55
<modelVersion>4.0.0</modelVersion>
66
<parent>
77
<groupId>com.github.binarywang</groupId>

weixin-java-common/src/main/java/me/chanjar/weixin/common/annotation/Required.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77

88
/**
99
* 标识某个字段是否是必填的
10-
*
10+
* <p>
1111
* Created by Binary Wang on 2016/9/25.
12-
* @author binarywang (https://github.com/binarywang)
1312
*
13+
* @author binarywang (https://github.com/binarywang)
1414
*/
1515
@Retention(RetentionPolicy.RUNTIME)
1616
@Target(ElementType.FIELD)
1717
public @interface Required {
1818

19-
}
19+
}

weixin-java-common/src/main/java/me/chanjar/weixin/common/api/WxConsts.java

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ public class WxConsts {
2424
public static final String XML_MSG_HARDWARE = "hardware";
2525
public static final String XML_TRANSFER_CUSTOMER_SERVICE = "transfer_customer_service";
2626

27-
2827
///////////////////////
2928
// 主动发送消息(即客服消息)的消息类型
3029
///////////////////////
@@ -88,50 +87,6 @@ public class WxConsts {
8887
public static final String EVT_LOCATION_SELECT = "location_select";
8988
public static final String EVT_TEMPLATESENDJOBFINISH = "TEMPLATESENDJOBFINISH";
9089
public static final String EVT_ENTER_AGENT = "enter_agent";
91-
public static final String EVT_CARD_PASS_CHECK = "card_pass_check";
92-
public static final String EVT_CARD_NOT_PASS_CHECK = "card_not_pass_check";
93-
public static final String EVT_USER_GET_CARD = "user_get_card";
94-
/**
95-
* 卡券转赠事件
96-
*/
97-
public static final String EVT_USER_GIFTING_CARD = "user_gifting_card";
98-
public static final String EVT_USER_DEL_CARD = "user_del_card";
99-
public static final String EVT_USER_CONSUME_CARD = "user_consume_card";
100-
public static final String EVT_USER_PAY_FROM_PAY_CELL = "user_pay_from_pay_cell";
101-
public static final String EVT_USER_VIEW_CARD = "user_view_card";
102-
public static final String EVT_USER_ENTER_SESSION_FROM_CARD = "user_enter_session_from_card";
103-
public static final String EVT_CARD_SKU_REMIND = "card_sku_remind"; // 库存报警
104-
public static final String EVT_KF_CREATE_SESSION = "kf_create_session"; // 客服接入会话
105-
public static final String EVT_KF_CLOSE_SESSION = "kf_close_session"; // 客服关闭会话
106-
public static final String EVT_KF_SWITCH_SESSION = "kf_switch_session"; // 客服转接会话
107-
public static final String EVT_POI_CHECK_NOTIFY = "poi_check_notify"; //门店审核事件推送
108-
public static final String EVT_SUBMIT_MEMBERCARD_USER_INFO = "submit_membercard_user_info"; //接收会员信息事件推送
109-
110-
//以下为微信认证事件
111-
/**
112-
* 资质认证成功
113-
*/
114-
public static final String EVT_QUALIFICATION_VERIFY_SUCCESS = "qualification_verify_success";
115-
/**
116-
* 资质认证失败
117-
*/
118-
public static final String EVT_QUALIFICATION_VERIFY_FAIL = "qualification_verify_fail";
119-
/**
120-
* 名称认证成功
121-
*/
122-
public static final String EVT_NAMING_VERIFY_SUCCESS = "naming_verify_success";
123-
/**
124-
* 名称认证失败
125-
*/
126-
public static final String EVT_NAMING_VERIFY_FAIL = "naming_verify_fail";
127-
/**
128-
* 年审通知
129-
*/
130-
public static final String EVT_ANNUAL_RENEW = "annual_renew";
131-
/**
132-
* 认证过期失效通知
133-
*/
134-
public static final String EVT_VERIFY_EXPIRED = "verify_expired";
13590

13691
///////////////////////
13792
// 上传多媒体文件的类型

weixin-java-common/src/main/java/me/chanjar/weixin/common/bean/result/WxMediaUploadResult.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public void setThumbMediaId(String thumbMediaId) {
5151
@Override
5252
public String toString() {
5353
return "WxUploadResult [type=" + this.type + ", media_id=" + this.mediaId + ", thumb_media_id=" + this.thumbMediaId
54-
+ ", created_at=" + this.createdAt + "]";
54+
+ ", created_at=" + this.createdAt + "]";
5555
}
5656

5757
}

weixin-java-common/src/main/java/me/chanjar/weixin/common/session/StandardSessionManager.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
public class StandardSessionManager implements WxSessionManager, InternalSessionManager {
1515

1616
protected static final StringManager sm =
17-
StringManager.getManager(Constants.Package);
17+
StringManager.getManager(Constants.Package);
1818
/**
1919
* The descriptive name of this Manager implementation (for logging).
2020
*/
@@ -82,7 +82,7 @@ public WxSession getSession(String sessionId) {
8282
public WxSession getSession(String sessionId, boolean create) {
8383
if (sessionId == null) {
8484
throw new IllegalStateException
85-
(sm.getString("sessionManagerImpl.getSession.ise"));
85+
(sm.getString("sessionManagerImpl.getSession.ise"));
8686
}
8787

8888
InternalSession session = findSession(sessionId);
@@ -135,15 +135,15 @@ public InternalSession findSession(String id) {
135135
public InternalSession createSession(String sessionId) {
136136
if (sessionId == null) {
137137
throw new IllegalStateException
138-
(sm.getString("sessionManagerImpl.createSession.ise"));
138+
(sm.getString("sessionManagerImpl.createSession.ise"));
139139
}
140140

141141
if ((this.maxActiveSessions >= 0) &&
142-
(getActiveSessions() >= this.maxActiveSessions)) {
142+
(getActiveSessions() >= this.maxActiveSessions)) {
143143
this.rejectedSessions++;
144144
throw new TooManyActiveSessionsException(
145-
sm.getString("sessionManagerImpl.createSession.tmase"),
146-
this.maxActiveSessions);
145+
sm.getString("sessionManagerImpl.createSession.tmase"),
146+
this.maxActiveSessions);
147147
}
148148

149149
// Recycle or create a Session instance

weixin-java-common/src/main/java/me/chanjar/weixin/common/session/TooManyActiveSessionsException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* reached and the server is refusing to create any new sessions.
2222
*/
2323
public class TooManyActiveSessionsException
24-
extends IllegalStateException {
24+
extends IllegalStateException {
2525
private static final long serialVersionUID = 1L;
2626

2727
/**

weixin-java-common/src/main/java/me/chanjar/weixin/common/util/ToStringUtils.java

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,10 @@
1313
*/
1414
public class ToStringUtils {
1515
public static final ToStringStyle THE_STYLE = new SimpleMultiLineToStringStyle();
16-
private static class SimpleMultiLineToStringStyle extends ToStringStyle {
17-
private static final long serialVersionUID = 4645306494220335355L;
18-
private static final String LINE_SEPARATOR = "\n";
19-
private static final String NULL_TEXT = "<null>";
20-
21-
public SimpleMultiLineToStringStyle() {
22-
super();
23-
this.setContentStart("[");
24-
this.setFieldSeparator(LINE_SEPARATOR + " ");
25-
this.setFieldSeparatorAtStart(true);
26-
this.setContentEnd(LINE_SEPARATOR + "]");
27-
this.setNullText(NULL_TEXT);
28-
this.setUseShortClassName(true);
29-
this.setUseIdentityHashCode(false);
30-
}
31-
}
3216

3317
/**
3418
* 用于产生去掉空值属性并以换行符分割各属性键值的toString字符串
19+
*
3520
* @param obj
3621
*/
3722
public static String toSimpleString(Object obj) {
@@ -58,4 +43,21 @@ public static String toSimpleString(Object obj) {
5843

5944
return result.deleteCharAt(result.length() - 1).toString();
6045
}
46+
47+
private static class SimpleMultiLineToStringStyle extends ToStringStyle {
48+
private static final long serialVersionUID = 4645306494220335355L;
49+
private static final String LINE_SEPARATOR = "\n";
50+
private static final String NULL_TEXT = "<null>";
51+
52+
public SimpleMultiLineToStringStyle() {
53+
super();
54+
this.setContentStart("[");
55+
this.setFieldSeparator(LINE_SEPARATOR + " ");
56+
this.setFieldSeparatorAtStart(true);
57+
this.setContentEnd(LINE_SEPARATOR + "]");
58+
this.setNullText(NULL_TEXT);
59+
this.setUseShortClassName(true);
60+
this.setUseIdentityHashCode(false);
61+
}
62+
}
6163
}

0 commit comments

Comments
 (0)