Skip to content

Commit 5a24283

Browse files
committed
⬆️ 升级sdk版本为4.6.0
1 parent addfa81 commit 5a24283

File tree

8 files changed

+22
-18
lines changed

8 files changed

+22
-18
lines changed

commit.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
git commit -a -m ":arrow_up: 升级sdk版本为4.6.0"
2+
git pull --rebase
3+
4+
git push origin master

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<maven.compiler.source>1.8</maven.compiler.source>
1515
<maven.compiler.target>1.8</maven.compiler.target>
1616

17-
<weixin-java-mp.version>4.5.0</weixin-java-mp.version>
17+
<weixin-java-mp.version>4.6.0</weixin-java-mp.version>
1818
<spring.version>6.0.14</spring.version>
1919
<spring-security.version>5.5.7</spring-security.version>
2020
<guava.version>32.0.0-jre</guava.version>

src/main/java/com/github/binarywang/demo/wx/mp/controller/WxMpPortalController.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
@RequestMapping("/wechat/portal")
1717
public class WxMpPortalController {
1818
private final Logger logger = LoggerFactory.getLogger(this.getClass());
19-
19+
2020
private WeixinService wxService;
2121

2222
@Autowired
@@ -30,7 +30,7 @@ public String authGet(@RequestParam(name = "signature", required = false) String
3030
@RequestParam(name = "timestamp", required = false) String timestamp,
3131
@RequestParam(name = "nonce", required = false) String nonce,
3232
@RequestParam(name = "echostr", required = false) String echostr) {
33-
this.logger.info("\n接收到来自微信服务器的认证消息:[{}, {}, {}, {}]", signature, timestamp, nonce, echostr);
33+
log.info("\n接收到来自微信服务器的认证消息:[{}, {}, {}, {}]", signature, timestamp, nonce, echostr);
3434

3535
if (StringUtils.isAnyBlank(signature, timestamp, nonce, echostr)) {
3636
throw new IllegalArgumentException("请求参数非法,请核实!");
@@ -49,7 +49,7 @@ public String post(@RequestBody String requestBody, @RequestParam("signature") S
4949
@RequestParam(name = "encrypt_type", required = false) String encType,
5050
@RequestParam(name = "msg_signature", required = false) String msgSignature,
5151
@RequestParam("timestamp") String timestamp, @RequestParam("nonce") String nonce) {
52-
this.logger.info("\n接收微信请求:[signature=[{}], encType=[{}], msgSignature=[{}],"
52+
log.info("\n接收微信请求:[signature=[{}], encType=[{}], msgSignature=[{}],"
5353
+ " timestamp=[{}], nonce=[{}], requestBody=[\n{}\n] ",
5454
signature, encType, msgSignature, timestamp, nonce, requestBody);
5555

@@ -71,7 +71,7 @@ public String post(@RequestBody String requestBody, @RequestParam("signature") S
7171
// aes加密的消息
7272
WxMpXmlMessage inMessage = WxMpXmlMessage.fromEncryptedXml(requestBody,
7373
this.wxService.getWxMpConfigStorage(), timestamp, nonce, msgSignature);
74-
this.logger.debug("\n消息解密后内容为:\n{} ", inMessage.toString());
74+
log.debug("\n消息解密后内容为:\n{} ", inMessage.toString());
7575
WxMpXmlOutMessage outMessage = this.wxService.route(inMessage);
7676
if (outMessage == null) {
7777
return "";
@@ -80,7 +80,7 @@ public String post(@RequestBody String requestBody, @RequestParam("signature") S
8080
out = outMessage.toEncryptedXml(this.wxService.getWxMpConfigStorage());
8181
}
8282

83-
this.logger.debug("\n组装回复信息:{}", out);
83+
log.debug("\n组装回复信息:{}", out);
8484

8585
return out;
8686
}

src/main/java/com/github/binarywang/demo/wx/mp/handler/LocationHandler.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@ public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage,
2727
String content = "感谢反馈,您的的地理位置已收到!";
2828
return new TextBuilder().build(content, wxMessage, null);
2929
} catch (Exception e) {
30-
this.logger.error("位置消息接收处理失败", e);
30+
log.error("位置消息接收处理失败", e);
3131
return null;
3232
}
3333
}
3434

3535
//上报地理位置事件
36-
this.logger.info("\n上报地理位置 。。。 ");
37-
this.logger.info("\n纬度 : " + wxMessage.getLatitude());
38-
this.logger.info("\n经度 : " + wxMessage.getLongitude());
39-
this.logger.info("\n精度 : " + String.valueOf(wxMessage.getPrecision()));
36+
log.info("\n上报地理位置 。。。 ");
37+
log.info("\n纬度 : " + wxMessage.getLatitude());
38+
log.info("\n经度 : " + wxMessage.getLongitude());
39+
log.info("\n精度 : " + String.valueOf(wxMessage.getPrecision()));
4040

4141
//TODO 可以将用户地理位置信息保存到本地数据库,以便以后使用
4242

src/main/java/com/github/binarywang/demo/wx/mp/handler/LogHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage,
2929
Map<String, Object> context, WxMpService wxMpService,
3030
WxSessionManager sessionManager) {
3131
try {
32-
this.logger.info("\n接收到请求消息,内容:{}", JSON.writeValueAsString(wxMessage));
32+
log.info("\n接收到请求消息,内容:{}", JSON.writeValueAsString(wxMessage));
3333
} catch (JsonProcessingException e) {
3434
e.printStackTrace();
3535
}

src/main/java/com/github/binarywang/demo/wx/mp/handler/SubscribeHandler.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class SubscribeHandler extends AbstractHandler {
2222
public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage, Map<String, Object> context, WxMpService wxMpService,
2323
WxSessionManager sessionManager) throws WxErrorException {
2424

25-
this.logger.info("新关注用户 OPENID: " + wxMessage.getFromUser());
25+
log.info("新关注用户 OPENID: " + wxMessage.getFromUser());
2626

2727
WeixinService weixinService = (WeixinService) wxMpService;
2828

@@ -37,7 +37,7 @@ public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage, Map<String, Object> co
3737
try {
3838
responseResult = handleSpecial(wxMessage);
3939
} catch (Exception e) {
40-
this.logger.error(e.getMessage(), e);
40+
log.error(e.getMessage(), e);
4141
}
4242

4343
if (responseResult != null) {
@@ -47,7 +47,7 @@ public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage, Map<String, Object> co
4747
try {
4848
return new TextBuilder().build("感谢关注", wxMessage, weixinService);
4949
} catch (Exception e) {
50-
this.logger.error(e.getMessage(), e);
50+
log.error(e.getMessage(), e);
5151
}
5252

5353
return null;

src/main/java/com/github/binarywang/demo/wx/mp/handler/UnsubscribeHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage,
1919
Map<String, Object> context, WxMpService wxMpService,
2020
WxSessionManager sessionManager) {
2121
String openId = wxMessage.getFromUser();
22-
this.logger.info("取消关注用户 OPENID: " + openId);
22+
log.info("取消关注用户 OPENID: " + openId);
2323
// TODO 可以更新本地数据库为取消关注状态
2424
return null;
2525
}

src/main/java/com/github/binarywang/demo/wx/mp/service/WeixinService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public WxMpXmlOutMessage route(WxMpXmlMessage message) {
126126
try {
127127
return this.router.route(message);
128128
} catch (Exception e) {
129-
this.logger.error(e.getMessage(), e);
129+
log.error(e.getMessage(), e);
130130
}
131131

132132
return null;
@@ -137,7 +137,7 @@ public boolean hasKefuOnline() {
137137
WxMpKfOnlineList kfOnlineList = this.getKefuService().kfOnlineList();
138138
return kfOnlineList != null && kfOnlineList.getKfOnlineList().size() > 0;
139139
} catch (Exception e) {
140-
this.logger.error("获取客服在线状态异常: " + e.getMessage(), e);
140+
log.error("获取客服在线状态异常: " + e.getMessage(), e);
141141
}
142142

143143
return false;

0 commit comments

Comments
 (0)