Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

多公众号管理下,两个问题修复 #1426

Merged
merged 6 commits into from
Mar 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,13 @@ public WxMpXmlOutMessage route(final WxMpXmlMessage wxMessage, final Map<String,
return route(wxMessage, context, null);
}

/**
* 处理不同appid微信消息
*/
public WxMpXmlOutMessage route(final String appid, final WxMpXmlMessage wxMessage, final Map<String, Object> context) {
return route(wxMessage, context, this.wxMpService.switchoverTo(appid));
}

/**
* 处理微信消息.
*/
Expand Down Expand Up @@ -228,6 +235,10 @@ public WxMpXmlOutMessage route(final WxMpXmlMessage wxMessage) {
return this.route(wxMessage, new HashMap<String, Object>(2));
}

public WxMpXmlOutMessage route(String appid, final WxMpXmlMessage wxMessage) {
return this.route(appid, wxMessage, new HashMap<String, Object>(2));
}

private boolean isMsgDuplicated(WxMpXmlMessage wxMessage) {
StringBuilder messageId = new StringBuilder();
if (wxMessage.getMsgId() == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,9 +399,6 @@ public void setMultiConfigStorages(Map<String, WxMpConfigStorage> configStorages
@Override
public void addConfigStorage(String mpId, WxMpConfigStorage configStorages) {
synchronized (this) {
if (this.configStorageMap.containsKey(mpId)) {
throw new RuntimeException("该公众号标识已存在,请更换其他标识!");
}
this.configStorageMap.put(mpId, configStorages);
}
}
Expand Down