Skip to content

Commit 9a26c75

Browse files
committed
Merge branch 'develop'
# Conflicts: # README.md
2 parents af92403 + 5c53319 commit 9a26c75

File tree

194 files changed

+5769
-2720
lines changed

Some content is hidden

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

194 files changed

+5769
-2720
lines changed

.editorconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# EditorConfig: http://editorconfig.org/
2+
3+
root = true
4+
5+
[*]
6+
indent_style = space
7+
indent_size = 2
8+
end_of_line = lf
9+
charset = utf-8
10+
trim_trailing_whitespace = true
11+
insert_final_newline = true
12+
13+
[*.md]
14+
trim_trailing_whitespace = false

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
### 注意:
66
1. ***本项目Fork自chanjarster/weixin-java-tools,但由于原项目已停止维护,故单独维护和发布,且发布到maven上的groupId也会不同,详细信息见下文。***
77
1. ***自2.0.0版本以来,主要是公众号的接口调整比较大,主要是为了解决主接口类过于庞大不方便管理的问题,将接口实现代码按模块进行拆分。***
8-
1. 最新更新:2016-08-31 发布2.1.0正式版!
8+
1. 最新更新:2016-09-30 发布2.2.0正式版!
99

1010
===========
1111

@@ -33,12 +33,12 @@ maven:
3333
<dependency>
3434
<groupId>com.github.binarywang</groupId>
3535
<artifactId>weixin-java-mp</artifactId>
36-
<version>2.1.0</version>
36+
<version>2.2.0</version>
3737
</dependency>
3838
```
3939
gradle:
4040
```groovy
41-
compile 'com.github.binarywang:weixin-java-mp:2.1.0'
41+
compile 'com.github.binarywang:weixin-java-mp:2.2.0'
4242
```
4343

4444
* 企业号:
@@ -48,12 +48,12 @@ maven:
4848
<dependency>
4949
<groupId>com.github.binarywang</groupId>
5050
<artifactId>weixin-java-cp</artifactId>
51-
<version>2.1.0</version>
51+
<version>2.2.0</version>
5252
</dependency>
5353
```
5454
gradle:
5555
```groovy
56-
compile 'com.github.binarywang:weixin-java-cp:2.1.0'
56+
compile 'com.github.binarywang:weixin-java-cp:2.2.0'
5757
```
5858

5959
#### 本项目主要存放在github上,地址为 :
@@ -74,4 +74,4 @@ compile 'com.github.binarywang:weixin-java-cp:2.1.0'
7474
* 本项目可以采用两种方式接受代码贡献:
7575

7676
1. 第一种就是基于[Git Flow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow)开发流程,因此在发起Pull Request的时候请选择develop分支。
77-
1. 另外一种贡献代码的方式就是加入SDK Developers开发组,如果对自己的代码足够自信,可以随时提交代码,注意要随时进行单元测试,保证提交代码没有明显问题,具体加入方式,请咨询管理员。
77+
1. 另外一种贡献代码的方式就是加入SDK Developers开发组,前提是对自己的代码足够自信就可以申请加入,加入之后可以随时直接提交代码,但要注意对所做的修改或新增的代码进行单元测试,保证提交代码没有明显问题,具体加入方式,请咨询管理员。

build.gradle

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ allprojects {
22
apply plugin: 'maven'
33

44
group = 'com.github.binarywang'
5-
version = '2.1.0-SNAPSHOT'
5+
version = '2.2.0'
66
}
77

88
subprojects {
@@ -13,8 +13,8 @@ subprojects {
1313

1414
repositories {
1515
mavenLocal()
16-
17-
maven { url "http://maven.aliyun.com/nexus/content/groups/public" }
16+
maven { url "http://central.maven.org/maven2" }
17+
//maven { url "http://maven.aliyun.com/nexus/content/groups/public" }
1818
}
1919

2020

@@ -24,6 +24,8 @@ subprojects {
2424
compile group: 'org.apache.httpcomponents', name: 'httpmime', version:'4.5'
2525
compile group: 'org.jodd', name: 'jodd-http', version:'3.6.7'
2626
compile group: 'com.google.code.gson', name: 'gson', version:'2.7'
27+
compile group: 'com.google.guava', name: 'guava', version:'19.0'
28+
compile group: 'org.jooq', name: 'joor', version:'0.9.6'
2729
compile group: 'commons-codec', name: 'commons-codec', version:'1.10'
2830
compile group: 'commons-io', name: 'commons-io', version:'2.5'
2931
compile group: 'org.apache.commons', name: 'commons-lang3', version:'3.4'

pom.xml

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<modelVersion>4.0.0</modelVersion>
66
<groupId>com.github.binarywang</groupId>
77
<artifactId>weixin-java-parent</artifactId>
8-
<version>2.1.0</version>
8+
<version>2.2.0</version>
99
<packaging>pom</packaging>
1010
<name>WeiXin Java Tools - Parent</name>
1111
<description>微信公众号、企业号上级POM</description>
@@ -49,9 +49,10 @@
4949
<slf4j.version>1.7.10</slf4j.version>
5050
<logback.version>1.1.2</logback.version>
5151
<jodd-http.version>3.6.7</jodd-http.version>
52-
<jackson.version>2.8.0</jackson.version>
5352
<jedis.version>2.9.0</jedis.version>
5453
<gson.version>2.7</gson.version>
54+
<guava.version>19.0</guava.version>
55+
<joor.version>0.9.6</joor.version>
5556
<commons-lang3.version>3.4</commons-lang3.version>
5657
<commons-io.version>2.5</commons-io.version>
5758
<commons-codec.version>1.10</commons-codec.version>
@@ -106,15 +107,19 @@
106107
<artifactId>commons-lang3</artifactId>
107108
<version>${commons-lang3.version}</version>
108109
</dependency>
109-
<dependency>
110-
<groupId>com.fasterxml.jackson.core</groupId>
111-
<artifactId>jackson-databind</artifactId>
112-
<version>${jackson.version}</version>
113-
</dependency>
114110
<dependency>
115111
<groupId>redis.clients</groupId>
116112
<artifactId>jedis</artifactId>
117113
<version>${jedis.version}</version>
114+
<scope>provided</scope>
115+
</dependency>
116+
<dependency>
117+
<groupId>com.google.guava</groupId>
118+
<artifactId>guava</artifactId>
119+
</dependency>
120+
<dependency>
121+
<groupId>org.jooq</groupId>
122+
<artifactId>joor</artifactId>
118123
</dependency>
119124
</dependencies>
120125

@@ -156,6 +161,16 @@
156161
<version>${jetty.version}</version>
157162
<scope>test</scope>
158163
</dependency>
164+
<dependency>
165+
<groupId>com.google.guava</groupId>
166+
<artifactId>guava</artifactId>
167+
<version>${guava.version}</version>
168+
</dependency>
169+
<dependency>
170+
<groupId>org.jooq</groupId>
171+
<artifactId>joor</artifactId>
172+
<version>${joor.version}</version>
173+
</dependency>
159174
</dependencies>
160175
</dependencyManagement>
161176

weixin-java-common/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>com.github.binarywang</groupId>
88
<artifactId>weixin-java-parent</artifactId>
9-
<version>2.1.0</version>
9+
<version>2.2.0</version>
1010
</parent>
1111

1212
<artifactId>weixin-java-common</artifactId>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package me.chanjar.weixin.common.annotation;
2+
3+
import java.lang.annotation.ElementType;
4+
import java.lang.annotation.Retention;
5+
import java.lang.annotation.RetentionPolicy;
6+
import java.lang.annotation.Target;
7+
8+
/**
9+
* 标识某个字段是否是必填的
10+
*
11+
* Created by Binary Wang on 2016/9/25.
12+
* @author binarywang (https://github.com/binarywang)
13+
*
14+
*/
15+
@Retention(RetentionPolicy.RUNTIME)
16+
@Target(ElementType.FIELD)
17+
public @interface Required {
18+
19+
}

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public class WxConsts {
3030
public static final String CUSTOM_MSG_MUSIC = "music";
3131
public static final String CUSTOM_MSG_NEWS = "news";
3232
public static final String CUSTOM_MSG_FILE = "file";
33+
public static final String CUSTOM_MSG_WXCARD = "wxcard";
3334
public static final String CUSTOM_MSG_TRANSFER_CUSTOMER_SERVICE = "transfer_customer_service";
3435
public static final String CUSTOM_MSG_SAFE_NO = "0";
3536
public static final String CUSTOM_MSG_SAFE_YES = "1";
@@ -61,7 +62,7 @@ public class WxConsts {
6162
/**
6263
* 群发反馈消息代码所对应的文字描述
6364
*/
64-
public static final Map<String, String> MASS_ST_2_DESC = new HashMap<String, String>();
65+
public static final Map<String, String> MASS_ST_2_DESC = new HashMap<>();
6566
///////////////////////
6667
// 微信端推送过来的事件类型
6768
///////////////////////
@@ -92,6 +93,8 @@ public class WxConsts {
9293
public static final String EVT_KF_CREATE_SESSION = "kf_create_session"; // 客服接入会话
9394
public static final String EVT_KF_CLOSE_SESSION = "kf_close_session"; // 客服关闭会话
9495
public static final String EVT_KF_SWITCH_SESSION = "kf_switch_session"; // 客服转接会话
96+
public static final String EVT_POI_CHECK_NOTIFY = "poi_check_notify"; //门店审核事件推送
97+
9598
///////////////////////
9699
// 上传多媒体文件的类型
97100
///////////////////////

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public class WxMessageInMemoryDuplicateChecker implements WxMessageDuplicateChec
2525
/**
2626
* 消息id->消息时间戳的map
2727
*/
28-
private final ConcurrentHashMap<String, Long> msgId2Timestamp = new ConcurrentHashMap<String, Long>();
28+
private final ConcurrentHashMap<String, Long> msgId2Timestamp = new ConcurrentHashMap<>();
2929

3030
/**
3131
* 后台清理线程是否已经开启
@@ -56,19 +56,19 @@ public WxMessageInMemoryDuplicateChecker(Long timeToLive, Long clearPeriod) {
5656
}
5757

5858
protected void checkBackgroundProcessStarted() {
59-
if (backgroundProcessStarted.getAndSet(true)) {
59+
if (this.backgroundProcessStarted.getAndSet(true)) {
6060
return;
6161
}
6262
Thread t = new Thread(new Runnable() {
6363
@Override
6464
public void run() {
6565
try {
6666
while (true) {
67-
Thread.sleep(clearPeriod);
67+
Thread.sleep(WxMessageInMemoryDuplicateChecker.this.clearPeriod);
6868
Long now = System.currentTimeMillis();
69-
for (Map.Entry<String, Long> entry : msgId2Timestamp.entrySet()) {
70-
if (now - entry.getValue() > timeToLive) {
71-
msgId2Timestamp.entrySet().remove(entry);
69+
for (Map.Entry<String, Long> entry : WxMessageInMemoryDuplicateChecker.this.msgId2Timestamp.entrySet()) {
70+
if (now - entry.getValue() > WxMessageInMemoryDuplicateChecker.this.timeToLive) {
71+
WxMessageInMemoryDuplicateChecker.this.msgId2Timestamp.entrySet().remove(entry);
7272
}
7373
}
7474
}
@@ -87,7 +87,7 @@ public boolean isDuplicate(String messageId) {
8787
return false;
8888
}
8989
checkBackgroundProcessStarted();
90-
Long timestamp = msgId2Timestamp.putIfAbsent(messageId, System.currentTimeMillis());
90+
Long timestamp = this.msgId2Timestamp.putIfAbsent(messageId, System.currentTimeMillis());
9191
return timestamp != null;
9292
}
9393

weixin-java-common/src/main/java/me/chanjar/weixin/common/bean/WxAccessToken.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ public static WxAccessToken fromJson(String json) {
1616
}
1717

1818
public String getAccessToken() {
19-
return accessToken;
19+
return this.accessToken;
2020
}
2121

2222
public void setAccessToken(String accessToken) {
2323
this.accessToken = accessToken;
2424
}
2525

2626
public int getExpiresIn() {
27-
return expiresIn;
27+
return this.expiresIn;
2828
}
2929

3030
public void setExpiresIn(int expiresIn) {

weixin-java-common/src/main/java/me/chanjar/weixin/common/bean/WxCardApiSignature.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,71 +39,71 @@ public String toString() {
3939
}
4040

4141
public String getAppId() {
42-
return appId;
42+
return this.appId;
4343
}
4444

4545
public void setAppId(String appId) {
4646
this.appId = appId;
4747
}
4848

4949
public String getCardId() {
50-
return cardId;
50+
return this.cardId;
5151
}
5252

5353
public void setCardId(String cardId) {
5454
this.cardId = cardId;
5555
}
5656

5757
public String getCardType() {
58-
return cardType;
58+
return this.cardType;
5959
}
6060

6161
public void setCardType(String cardType) {
6262
this.cardType = cardType;
6363
}
6464

6565
public String getLocationId() {
66-
return locationId;
66+
return this.locationId;
6767
}
6868

6969
public void setLocationId(String locationId) {
7070
this.locationId = locationId;
7171
}
7272

7373
public String getCode() {
74-
return code;
74+
return this.code;
7575
}
7676

7777
public void setCode(String code) {
7878
this.code = code;
7979
}
8080

8181
public String getOpenId() {
82-
return openId;
82+
return this.openId;
8383
}
8484

8585
public void setOpenId(String openId) {
8686
this.openId = openId;
8787
}
8888

8989
public Long getTimestamp() {
90-
return timestamp;
90+
return this.timestamp;
9191
}
9292

9393
public void setTimestamp(Long timestamp) {
9494
this.timestamp = timestamp;
9595
}
9696

9797
public String getNonceStr() {
98-
return nonceStr;
98+
return this.nonceStr;
9999
}
100100

101101
public void setNonceStr(String nonceStr) {
102102
this.nonceStr = nonceStr;
103103
}
104104

105105
public String getSignature() {
106-
return signature;
106+
return this.signature;
107107
}
108108

109109
public void setSignature(String signature) {

0 commit comments

Comments
 (0)