mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-05-04 20:57:47 +08:00
🆕 #3079 【企业微信】增加提醒成员群发和停止企业群发的接口
This commit is contained in:
parent
831aac31ba
commit
753497579c
@ -690,6 +690,39 @@ public interface WxCpExternalContactService {
|
|||||||
*/
|
*/
|
||||||
WxCpMsgTemplateAddResult addMsgTemplate(WxCpMsgTemplate wxCpMsgTemplate) throws WxErrorException;
|
WxCpMsgTemplateAddResult addMsgTemplate(WxCpMsgTemplate wxCpMsgTemplate) throws WxErrorException;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提醒成员群发
|
||||||
|
* 企业和第三方应用可调用此接口,重新触发群发通知,提醒成员完成群发任务,24小时内每个群发最多触发三次提醒。
|
||||||
|
* <p>
|
||||||
|
* 请求方式: POST(HTTPS)
|
||||||
|
* <p>
|
||||||
|
* 请求地址:https://qyapi.weixin.qq.com/cgi-bin/externalcontact/remind_groupmsg_send?access_token=ACCESS_TOKEN
|
||||||
|
* <p>
|
||||||
|
* <a href="https://developer.work.weixin.qq.com/document/path/97610">文档地址</a>
|
||||||
|
*
|
||||||
|
* @param msgId 群发消息的id,通过获取群发记录列表接口返回
|
||||||
|
* @return the wx cp msg template add result
|
||||||
|
*/
|
||||||
|
WxCpBaseResp remindGroupMsgSend(String msgId) throws WxErrorException;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 停止企业群发
|
||||||
|
* 企业和第三方应用可调用此接口,停止无需成员继续发送的企业群发
|
||||||
|
* <p>
|
||||||
|
* 请求方式: POST(HTTPS)
|
||||||
|
* <p>
|
||||||
|
* 请求地址:https://qyapi.weixin.qq.com/cgi-bin/externalcontact/cancel_groupmsg_send?access_token=ACCESS_TOKEN
|
||||||
|
* <p>
|
||||||
|
* <a href="https://developer.work.weixin.qq.com/document/path/97611">文档地址</a>
|
||||||
|
*
|
||||||
|
* @param msgId 群发消息的id,通过获取群发记录列表接口返回
|
||||||
|
* @return the wx cp msg template add result
|
||||||
|
*/
|
||||||
|
WxCpBaseResp cancelGroupMsgSend(String msgId) throws WxErrorException;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发送新客户欢迎语
|
* 发送新客户欢迎语
|
||||||
* <pre>
|
* <pre>
|
||||||
|
@ -418,6 +418,24 @@ public class WxCpExternalContactServiceImpl implements WxCpExternalContactServic
|
|||||||
return WxCpMsgTemplateAddResult.fromJson(this.mainService.post(url, wxCpMsgTemplate.toJson()));
|
return WxCpMsgTemplateAddResult.fromJson(this.mainService.post(url, wxCpMsgTemplate.toJson()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WxCpBaseResp remindGroupMsgSend(String msgId) throws WxErrorException {
|
||||||
|
JsonObject params = new JsonObject();
|
||||||
|
params.addProperty("msgid", msgId);
|
||||||
|
final String url = this.mainService.getWxCpConfigStorage()
|
||||||
|
.getApiUrl(REMIND_GROUP_MSG_SEND);
|
||||||
|
return WxCpBaseResp.fromJson(this.mainService.post(url, params.toString()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WxCpBaseResp cancelGroupMsgSend(String msgId) throws WxErrorException {
|
||||||
|
JsonObject params = new JsonObject();
|
||||||
|
params.addProperty("msgid", msgId);
|
||||||
|
final String url = this.mainService.getWxCpConfigStorage()
|
||||||
|
.getApiUrl(CANCEL_GROUP_MSG_SEND);
|
||||||
|
return WxCpBaseResp.fromJson(this.mainService.post(url, params.toString()));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendWelcomeMsg(WxCpWelcomeMsg msg) throws WxErrorException {
|
public void sendWelcomeMsg(WxCpWelcomeMsg msg) throws WxErrorException {
|
||||||
final String url = this.mainService.getWxCpConfigStorage().getApiUrl(SEND_WELCOME_MSG);
|
final String url = this.mainService.getWxCpConfigStorage().getApiUrl(SEND_WELCOME_MSG);
|
||||||
|
@ -1148,6 +1148,14 @@ public interface WxCpApiPathConsts {
|
|||||||
* The constant ADD_MSG_TEMPLATE.
|
* The constant ADD_MSG_TEMPLATE.
|
||||||
*/
|
*/
|
||||||
String ADD_MSG_TEMPLATE = "/cgi-bin/externalcontact/add_msg_template";
|
String ADD_MSG_TEMPLATE = "/cgi-bin/externalcontact/add_msg_template";
|
||||||
|
/**
|
||||||
|
* 提醒成员群发
|
||||||
|
*/
|
||||||
|
String REMIND_GROUP_MSG_SEND = "/cgi-bin/externalcontact/remind_groupmsg_send";
|
||||||
|
/**
|
||||||
|
* 停止企业群发
|
||||||
|
*/
|
||||||
|
String CANCEL_GROUP_MSG_SEND = "/cgi-bin/externalcontact/cancel_groupmsg_send";
|
||||||
/**
|
/**
|
||||||
* The constant SEND_WELCOME_MSG.
|
* The constant SEND_WELCOME_MSG.
|
||||||
*/
|
*/
|
||||||
|
@ -615,4 +615,26 @@ public class WxCpExternalContactServiceImplTest {
|
|||||||
|
|
||||||
this.wxCpService.getExternalContactService().getJoinWay(configId);
|
this.wxCpService.getExternalContactService().getJoinWay(configId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提醒成员群发
|
||||||
|
*
|
||||||
|
* @throws WxErrorException
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testRemindGroupMsgSend() throws WxErrorException {
|
||||||
|
this.wxCpService.getExternalContactService()
|
||||||
|
.remindGroupMsgSend("msgGCAAAXtWyujaWJHDDGi0mACAAAA");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 测试取消提醒成员群发
|
||||||
|
*
|
||||||
|
* @throws WxErrorException
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testCancelGroupMsgSend() throws WxErrorException {
|
||||||
|
this.wxCpService.getExternalContactService()
|
||||||
|
.cancelGroupMsgSend("msgGCAAAXtWyujaWJHDDGi0mACAAAA");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user