Skip to content

Commit 5bbf578

Browse files
authored
Merge pull request #1 from wechat-group/develop
同步Develop
2 parents 4047f6d + 6f297ae commit 5bbf578

File tree

145 files changed

+1076
-820
lines changed

Some content is hidden

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

145 files changed

+1076
-820
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
### 声明:本项目Fork自chanjarster/weixin-java-tools,但由于原项目已停止维护,故单独维护和发布,且发布到maven上的groupId也会不同,详细信息见下文。
66

7-
### 最新更新:2.0.0版发布!!! on 2016-07-31
8-
#### 由于本次更新涉及接口调整比较大,主要是公众号的调整,企业号无过多调整,主要是为了解决主接口类过于庞大不方便管理的问题,将接口实现代码按模块进行拆分。因此版本号直接从1.X.X直接升级到2.0.0,所以如果习惯于1.X.X版本的同学不想做过多更改的话,请慎重考虑升级到最新版本
7+
### 最新更新:2.1.0版发布!!! on 2016-08-31
8+
#### 自2.0.0版本以来,接口调整比较大,主要是公众号的调整,企业号无过多调整,主要是为了解决主接口类过于庞大不方便管理的问题,将接口实现代码按模块进行拆分。所以如果习惯于1.X.X版本的同学不想做过多更改的话,请慎重考虑升级到2.X.X版本
99
---
1010

1111
### 详细开发文档请看 [wiki](https://github.com/chanjarster/weixin-java-tools/wiki)
@@ -32,25 +32,25 @@
3232
<dependency>
3333
<groupId>com.github.binarywang</groupId>
3434
<artifactId>weixin-java-mp</artifactId>
35-
<version>2.0.0</version>
35+
<version>2.1.0</version>
3636
</dependency>
3737
```
3838

3939
```groovy
40-
compile 'com.github.binarywang:weixin-java-mp:2.0.0'
40+
compile 'com.github.binarywang:weixin-java-mp:2.1.0'
4141
```
4242

4343
* 企业号:
4444
```xml
4545
<dependency>
4646
<groupId>com.github.binarywang</groupId>
4747
<artifactId>weixin-java-cp</artifactId>
48-
<version>2.0.0</version>
48+
<version>2.1.0</version>
4949
</dependency>
5050
```
5151

5252
```groovy
53-
compile 'com.github.binarywang:weixin-java-cp:2.0.0'
53+
compile 'com.github.binarywang:weixin-java-cp:2.1.0'
5454
```
5555

5656
#### 本项目主要存放在github上,地址为 :

pom.xml

Lines changed: 1 addition & 1 deletion
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-SNAPSHOT</version>
8+
<version>2.1.0</version>
99
<packaging>pom</packaging>
1010
<name>WeiXin Java Tools - Parent</name>
1111
<description>微信公众号、企业号上级POM</description>

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-SNAPSHOT</version>
9+
<version>2.1.0</version>
1010
</parent>
1111

1212
<artifactId>weixin-java-common</artifactId>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public class WxConsts {
6161
/**
6262
* 群发反馈消息代码所对应的文字描述
6363
*/
64-
public static final Map<String, String> MASS_ST_2_DESC = new HashMap<String, String>();
64+
public static final Map<String, String> MASS_ST_2_DESC = new HashMap<>();
6565
///////////////////////
6666
// 微信端推送过来的事件类型
6767
///////////////////////

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) {

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,39 +19,39 @@ public class WxJsapiSignature implements Serializable {
1919
private String signature;
2020

2121
public String getSignature() {
22-
return signature;
22+
return this.signature;
2323
}
2424

2525
public void setSignature(String signature) {
2626
this.signature = signature;
2727
}
2828

2929
public String getNoncestr() {
30-
return noncestr;
30+
return this.noncestr;
3131
}
3232

3333
public void setNoncestr(String noncestr) {
3434
this.noncestr = noncestr;
3535
}
3636

3737
public long getTimestamp() {
38-
return timestamp;
38+
return this.timestamp;
3939
}
4040

4141
public void setTimestamp(long timestamp) {
4242
this.timestamp = timestamp;
4343
}
4444

4545
public String getUrl() {
46-
return url;
46+
return this.url;
4747
}
4848

4949
public void setUrl(String url) {
5050
this.url = url;
5151
}
5252

5353
public String getAppid() {
54-
return appid;
54+
return this.appid;
5555
}
5656

5757
public void setAppid(String appid) {

weixin-java-common/src/main/java/me/chanjar/weixin/common/bean/menu/WxMenu.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class WxMenu implements Serializable {
1919

2020
private static final long serialVersionUID = -7083914585539687746L;
2121

22-
private List<WxMenuButton> buttons = new ArrayList<WxMenuButton>();
22+
private List<WxMenuButton> buttons = new ArrayList<>();
2323

2424
private WxMenuRule matchRule;
2525

@@ -40,15 +40,15 @@ public static WxMenu fromJson(InputStream is) {
4040
}
4141

4242
public List<WxMenuButton> getButtons() {
43-
return buttons;
43+
return this.buttons;
4444
}
4545

4646
public void setButtons(List<WxMenuButton> buttons) {
4747
this.buttons = buttons;
4848
}
4949

5050
public WxMenuRule getMatchRule() {
51-
return matchRule;
51+
return this.matchRule;
5252
}
5353

5454
public void setMatchRule(WxMenuRule matchRule) {
@@ -62,7 +62,7 @@ public String toJson() {
6262
@Override
6363
public String toString() {
6464
return "WxMenu{" +
65-
"buttons=" + buttons +
65+
"buttons=" + this.buttons +
6666
'}';
6767
}
6868

weixin-java-common/src/main/java/me/chanjar/weixin/common/bean/menu/WxMenuButton.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class WxMenuButton {
1414
private String url;
1515
private String mediaId;
1616

17-
private List<WxMenuButton> subButtons = new ArrayList<WxMenuButton>();
17+
private List<WxMenuButton> subButtons = new ArrayList<>();
1818

1919
@Override
2020
public String toString() {
@@ -23,47 +23,47 @@ public String toString() {
2323
}
2424

2525
public String getType() {
26-
return type;
26+
return this.type;
2727
}
2828

2929
public void setType(String type) {
3030
this.type = type;
3131
}
3232

3333
public String getName() {
34-
return name;
34+
return this.name;
3535
}
3636

3737
public void setName(String name) {
3838
this.name = name;
3939
}
4040

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

4545
public void setKey(String key) {
4646
this.key = key;
4747
}
4848

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

5353
public void setUrl(String url) {
5454
this.url = url;
5555
}
5656

5757
public List<WxMenuButton> getSubButtons() {
58-
return subButtons;
58+
return this.subButtons;
5959
}
6060

6161
public void setSubButtons(List<WxMenuButton> subButtons) {
6262
this.subButtons = subButtons;
6363
}
6464

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

6969
public void setMediaId(String mediaId) {

0 commit comments

Comments
 (0)