|
31 | 31 | import me.chanjar.weixin.cp.bean.external.WxCpUserTransferResultResp;
|
32 | 32 | import me.chanjar.weixin.cp.bean.external.WxCpUserWithExternalPermission;
|
33 | 33 | import me.chanjar.weixin.cp.bean.external.WxCpWelcomeMsg;
|
34 |
| -import me.chanjar.weixin.cp.bean.external.contact.WxCpExternalContactBatchInfo; |
35 |
| -import me.chanjar.weixin.cp.bean.external.contact.WxCpExternalContactInfo; |
| 34 | +import me.chanjar.weixin.cp.bean.external.contact.*; |
36 | 35 | import org.apache.commons.lang3.ArrayUtils;
|
37 | 36 | import org.apache.commons.lang3.StringUtils;
|
38 | 37 | import org.jetbrains.annotations.NotNull;
|
@@ -449,4 +448,86 @@ public WxCpBaseResp markTag(String userid, String externalUserid, String[] addTa
|
449 | 448 | final String result = this.mainService.post(url, json.toString());
|
450 | 449 | return WxCpBaseResp.fromJson(result);
|
451 | 450 | }
|
| 451 | + |
| 452 | + /** |
| 453 | + * <pre> |
| 454 | + * 企业和第三方应用可通过此接口获取企业与成员的群发记录。 |
| 455 | + * https://work.weixin.qq.com/api/doc/90000/90135/93338 |
| 456 | + * </pre> |
| 457 | + * |
| 458 | + * @param chatType 群发任务的类型,默认为single,表示发送给客户,group表示发送给客户群 |
| 459 | + * @param startTime 群发任务记录开始时间 |
| 460 | + * @param endTime 群发任务记录结束时间 |
| 461 | + * @param creator 群发任务创建人企业账号id |
| 462 | + * @param filterType 创建人类型。0:企业发表 1:个人发表 2:所有,包括个人创建以及企业创建,默认情况下为所有类型 |
| 463 | + * @param limit 返回的最大记录数,整型,最大值100,默认值50,超过最大值时取默认值 |
| 464 | + * @param cursor 用于分页查询的游标,字符串类型,由上一次调用返回,首次调用可不填 |
| 465 | + * @return wx cp base resp |
| 466 | + * @throws WxErrorException the wx error exception |
| 467 | + */ |
| 468 | + @Override |
| 469 | + public WxCpGroupMsgListResult getGroupMsgListV2(String chatType, @NonNull Date startTime, @NonNull Date endTime, String creator, Integer filterType, Integer limit, String cursor) throws WxErrorException { |
| 470 | + JsonObject json = new JsonObject(); |
| 471 | + json.addProperty("chat_type", chatType); |
| 472 | + json.addProperty("start_time", startTime.getTime() / 1000); |
| 473 | + json.addProperty("end_time", endTime.getTime() / 1000); |
| 474 | + json.addProperty("creator", creator); |
| 475 | + json.addProperty("filter_type", filterType); |
| 476 | + json.addProperty("limit", limit); |
| 477 | + json.addProperty("cursor", cursor); |
| 478 | + |
| 479 | + final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GET_GROUP_MSG_SEND_RESULT); |
| 480 | + final String result = this.mainService.post(url, json.toString()); |
| 481 | + return WxCpGroupMsgListResult.fromJson(result); |
| 482 | + } |
| 483 | + |
| 484 | + /** |
| 485 | + * <pre> |
| 486 | + * 企业和第三方应用可通过此接口获取企业与成员的群发记录。 |
| 487 | + * https://work.weixin.qq.com/api/doc/90000/90135/93338#获取企业群发成员执行结果 |
| 488 | + * </pre> |
| 489 | + * |
| 490 | + * @param msgid 群发消息的id,通过获取群发记录列表接口返回 |
| 491 | + * @param userid 发送成员userid,通过获取群发成员发送任务列表接口返回 |
| 492 | + * @param limit 返回的最大记录数,整型,最大值1000,默认值500,超过最大值时取默认值 |
| 493 | + * @param cursor 用于分页查询的游标,字符串类型,由上一次调用返回,首次调用可不填 |
| 494 | + * @return wx cp base resp |
| 495 | + * @throws WxErrorException the wx error exception |
| 496 | + */ |
| 497 | + @Override |
| 498 | + public WxCpGroupMsgSendResult getGroupMsgSendResult(String msgid, String userid, Integer limit, String cursor) throws WxErrorException { |
| 499 | + JsonObject json = new JsonObject(); |
| 500 | + json.addProperty("msgid", msgid); |
| 501 | + json.addProperty("userid", userid); |
| 502 | + json.addProperty("limit", limit); |
| 503 | + json.addProperty("cursor", cursor); |
| 504 | + |
| 505 | + final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GET_GROUP_MSG_SEND_RESULT); |
| 506 | + final String result = this.mainService.post(url, json.toString()); |
| 507 | + return WxCpGroupMsgSendResult.fromJson(result); |
| 508 | + } |
| 509 | + |
| 510 | + /** |
| 511 | + * <pre> |
| 512 | + * 获取群发成员发送任务列表。 |
| 513 | + * https://work.weixin.qq.com/api/doc/90000/90135/93338#获取群发成员发送任务列表 |
| 514 | + * </pre> |
| 515 | + * |
| 516 | + * @param msgid 群发消息的id,通过获取群发记录列表接口返回 |
| 517 | + * @param limit 返回的最大记录数,整型,最大值1000,默认值500,超过最大值时取默认值 |
| 518 | + * @param cursor 用于分页查询的游标,字符串类型,由上一次调用返回,首次调用可不填 |
| 519 | + * @return wx cp base resp |
| 520 | + * @throws WxErrorException the wx error exception |
| 521 | + */ |
| 522 | + @Override |
| 523 | + public WxCpGroupMsgTaskResult getGroupMsgTask(String msgid, Integer limit, String cursor) throws WxErrorException { |
| 524 | + JsonObject json = new JsonObject(); |
| 525 | + json.addProperty("msgid", msgid); |
| 526 | + json.addProperty("limit", limit); |
| 527 | + json.addProperty("cursor", cursor); |
| 528 | + |
| 529 | + final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GET_GROUP_MSG_SEND_RESULT); |
| 530 | + final String result = this.mainService.post(url, json.toString()); |
| 531 | + return WxCpGroupMsgTaskResult.fromJson(result); |
| 532 | + } |
452 | 533 | }
|
0 commit comments