1
0
mirror of synced 2026-02-12 15:17:51 +08:00

#315 修改messageSend方法,自动从wxCpConfigStorage获取agentId

This commit is contained in:
forfuns
2017-08-17 15:33:45 +08:00
committed by Binary Wang
parent 92947b344a
commit f0d3a1af73
2 changed files with 9 additions and 3 deletions

View File

@@ -131,6 +131,10 @@ public abstract class WxCpServiceAbstractImpl<H, P> implements WxCpService, Requ
@Override
public WxCpMessageSendResult messageSend(WxCpMessage message) throws WxErrorException {
String url = "https://qyapi.weixin.qq.com/cgi-bin/message/send";
Integer agentId = message.getAgentId();
if(null == agentId){
message.setAgentId(this.getWxCpConfigStorage().getAgentId());
}
return WxCpMessageSendResult.fromJson(this.post(url, message.toJson()));
}