From 75aa3fce9a59360dfe8aebc79a36a912ab40610b Mon Sep 17 00:00:00 2001 From: Zeyes Lee Date: Wed, 18 Dec 2024 21:50:53 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20#3445=20=E3=80=90=E4=BC=81=E4=B8=9A?= =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E3=80=91=E7=AC=AC=E4=B8=89=E6=96=B9=E5=BA=94?= =?UTF-8?q?=E7=94=A8=E5=BC=80=E5=8F=91=E6=B6=88=E6=81=AF=E5=A4=84=E7=90=86?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E9=87=8D=E5=A4=8D=E7=9A=84=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../weixin/channel/message/WxChannelMessageRouter.java | 4 ++-- .../java/me/chanjar/weixin/cp/message/WxCpMessageRouter.java | 2 +- .../me/chanjar/weixin/cp/tp/message/WxCpTpMessageRouter.java | 5 +++-- .../cn/binarywang/wx/miniapp/message/WxMaMessageRouter.java | 2 +- .../java/me/chanjar/weixin/mp/api/WxMpMessageRouter.java | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/message/WxChannelMessageRouter.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/message/WxChannelMessageRouter.java index 8ccc2c505..16fb0781c 100644 --- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/message/WxChannelMessageRouter.java +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/message/WxChannelMessageRouter.java @@ -178,7 +178,7 @@ public class WxChannelMessageRouter { * @param wxMessage 消息 * @return 是否重复 */ - private boolean isMsgDuplicated(WxChannelMessage wxMessage) { + protected boolean isMsgDuplicated(WxChannelMessage wxMessage) { String messageId = this.generateMessageId(wxMessage); return this.messageDuplicateChecker.isDuplicate(messageId); } @@ -188,7 +188,7 @@ public class WxChannelMessageRouter { * * @return 消息id */ - private String generateMessageId(WxChannelMessage wxMessage) { + protected String generateMessageId(WxChannelMessage wxMessage) { StringBuilder sb = new StringBuilder(); if (wxMessage.getMsgId() == null) { sb.append(wxMessage.getCreateTime()) diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/message/WxCpMessageRouter.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/message/WxCpMessageRouter.java index e2daeab54..a2417ec86 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/message/WxCpMessageRouter.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/message/WxCpMessageRouter.java @@ -258,7 +258,7 @@ public class WxCpMessageRouter { return this.route(wxMessage, new HashMap<>(2)); } - private boolean isMsgDuplicated(WxCpXmlMessage wxMessage) { + protected boolean isMsgDuplicated(WxCpXmlMessage wxMessage) { StringBuilder messageId = new StringBuilder(); if (wxMessage.getMsgId() == null) { messageId.append(wxMessage.getCreateTime()) diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/message/WxCpTpMessageRouter.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/message/WxCpTpMessageRouter.java index 1df52149c..8887a23d5 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/message/WxCpTpMessageRouter.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/message/WxCpTpMessageRouter.java @@ -278,7 +278,7 @@ public class WxCpTpMessageRouter { return this.route(wxMessage, new HashMap<>(2)); } - private boolean isMsgDuplicated(final String suiteId, WxCpTpXmlMessage wxMessage) { + protected boolean isMsgDuplicated(final String suiteId, WxCpTpXmlMessage wxMessage) { StringBuilder messageId = new StringBuilder(); messageId.append(wxMessage.getToUserName()); if (wxMessage.getInfoType() != null) { @@ -306,7 +306,8 @@ public class WxCpTpMessageRouter { .append("-").append(wxMessage.getCreateTime()) .append("-").append(wxMessage.getFromUserName()) .append("-").append(StringUtils.trimToEmpty(wxMessage.getEvent())) - .append("-").append(StringUtils.trimToEmpty(wxMessage.getEventKey())); + .append("-").append(StringUtils.trimToEmpty(wxMessage.getEventKey())) + .append("-").append(StringUtils.trimToEmpty(wxMessage.getExternalUserID())); } } diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/message/WxMaMessageRouter.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/message/WxMaMessageRouter.java index 6cd603929..3d81b6d66 100644 --- a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/message/WxMaMessageRouter.java +++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/message/WxMaMessageRouter.java @@ -173,7 +173,7 @@ public class WxMaMessageRouter { return this.route(wxMessage, new HashMap<>(2)); } - private boolean isMsgDuplicated(WxMaMessage wxMessage) { + protected boolean isMsgDuplicated(WxMaMessage wxMessage) { StringBuilder messageId = new StringBuilder(); if (wxMessage.getMsgId() == null) { messageId.append(wxMessage.getCreateTime()) diff --git a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpMessageRouter.java b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpMessageRouter.java index 070e952c0..f2a28c668 100644 --- a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpMessageRouter.java +++ b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpMessageRouter.java @@ -315,7 +315,7 @@ public class WxMpMessageRouter { return this.route(appid, wxMessage, new HashMap<>(2)); } - private boolean isMsgDuplicated(WxMpXmlMessage wxMessage) { + protected boolean isMsgDuplicated(WxMpXmlMessage wxMessage) { StringBuilder messageId = new StringBuilder(); if (wxMessage.getMsgId() == null) { messageId.append(wxMessage.getCreateTime())