Skip to content

Commit 371a59d

Browse files
authored
🆕 #3164 【企业微信】增加停止发表企业朋友圈的接口
1 parent 5977567 commit 371a59d

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpExternalContactService.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -847,6 +847,20 @@ WxCpUserExternalGroupChatStatistic getGroupChatStatistic(Date startTime, Integer
847847
*/
848848
WxCpGetMomentTaskResult getMomentTaskResult(String jobId) throws WxErrorException;
849849

850+
851+
/**
852+
* <pre>
853+
* 停止发表企业朋友圈。
854+
* <a href="https://developer.work.weixin.qq.com/document/path/97612">文档地址</a>
855+
* </pre>
856+
*
857+
* @param momentId 朋友圈id,可通过<a href="https://developer.work.weixin.qq.com/document/path/97612#25254/%E8%8E%B7%E5%8F%96%E5%AE%A2%E6%88%B7%E6%9C%8B%E5%8F%8B%E5%9C%88%E4%BC%81%E4%B8%9A%E5%8F%91%E8%A1%A8%E7%9A%84%E5%88%97%E8%A1%A8">获取客户朋友圈企业发表的列表</a>接口获取朋友圈企业发表的列表
858+
* @return wx cp add moment result
859+
* @throws WxErrorException the wx error exception
860+
*/
861+
WxCpBaseResp cancelMomentTask(String momentId) throws WxErrorException;
862+
863+
850864
/**
851865
* <pre>
852866
* 获取客户朋友圈全部的发表记录 获取企业全部的发表列表

weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpExternalContactServiceImpl.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,14 @@ public WxCpGetMomentTaskResult getMomentTaskResult(String jobId) throws WxErrorE
530530
return WxCpGetMomentTaskResult.fromJson(this.mainService.get(url, params));
531531
}
532532

533+
@Override
534+
public WxCpBaseResp cancelMomentTask(String momentId) throws WxErrorException {
535+
final String url = this.mainService.getWxCpConfigStorage().getApiUrl(CANCEL_MOMENT_TASK);
536+
JsonObject json = new JsonObject();
537+
json.addProperty("moment_id", momentId);
538+
return WxCpBaseResp.fromJson(this.mainService.post(url, json.toString()));
539+
}
540+
533541
@Override
534542
public WxCpGetMomentList getMomentList(Long startTime, Long endTime, String creator, Integer filterType,
535543
String cursor, Integer limit) throws WxErrorException {

weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,6 +1233,12 @@ interface ExternalContact {
12331233
* The constant GET_MOMENT_TASK_RESULT.
12341234
*/
12351235
String GET_MOMENT_TASK_RESULT = "/cgi-bin/externalcontact/get_moment_task_result";
1236+
1237+
/**
1238+
* 停止发表企业朋友圈
1239+
*/
1240+
String CANCEL_MOMENT_TASK = "/cgi-bin/externalcontact/cancel_moment_task";
1241+
12361242
/**
12371243
* The constant GET_MOMENT_LIST.
12381244
*/

0 commit comments

Comments
 (0)