mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2026-02-16 13:26:23 +08:00
#315 修改messageSend方法,自动从wxCpConfigStorage获取agentId
This commit is contained in:
@@ -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()));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user