1
0
mirror of synced 2026-02-15 09:17:57 +08:00

🆕 #2642【企业微信】增加客户群加入群聊管理相关接口

This commit is contained in:
Jc826
2022-05-13 16:29:56 +08:00
committed by GitHub
parent 6177ca05b8
commit 458e7c3d24
6 changed files with 253 additions and 5 deletions

View File

@@ -12,14 +12,13 @@ import me.chanjar.weixin.cp.bean.external.contact.WxCpExternalContactInfo;
import me.chanjar.weixin.cp.bean.external.msg.Attachment;
import me.chanjar.weixin.cp.bean.external.msg.Image;
import me.chanjar.weixin.cp.bean.external.msg.Video;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.testng.annotations.Guice;
import org.testng.annotations.Test;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.*;
import org.testng.collections.CollectionUtils;
import static org.testng.Assert.assertNotNull;
@@ -337,4 +336,51 @@ public class WxCpExternalContactServiceImplTest {
assertNotNull(result);
}
@Test
public void testAddJoinWay() throws WxErrorException {
WxCpGroupJoinWayInfo.JoinWay joinWay = new WxCpGroupJoinWayInfo.JoinWay();
joinWay.setChatIdList(Arrays.asList("wrfpBaCwAAxR-iIqIUa5vvbpZQcAexJA"));
joinWay.setScene(2);
joinWay.setAutoCreateRoom(1);
joinWay.setRemark("CreateDate:" + DateFormatUtils.ISO_8601_EXTENDED_DATETIME_FORMAT.format(new Date()));
WxCpGroupJoinWayInfo info = new WxCpGroupJoinWayInfo();
info.setJoinWay(joinWay);
this.wxCpService.getExternalContactService().addJoinWay(info);
}
@Test
public void testUpdateJoinWay() throws WxErrorException {
final String configId = "";
WxCpGroupJoinWayInfo.JoinWay joinWay = new WxCpGroupJoinWayInfo.JoinWay();
joinWay.setConfigId(configId);
joinWay.setChatIdList(Arrays.asList("wrfpBaCwAAxR-iIqIUa5vvbpZQcAexJA"));
joinWay.setScene(2);
joinWay.setAutoCreateRoom(1);
joinWay.setRemark("CreateDate:" + DateFormatUtils.ISO_8601_EXTENDED_DATETIME_FORMAT.format(new Date()));
WxCpGroupJoinWayInfo info = new WxCpGroupJoinWayInfo();
info.setJoinWay(joinWay);
this.wxCpService.getExternalContactService().updateJoinWay(info);
}
@Test
public void testDelJoinWay() throws WxErrorException {
final String configId = "";
this.wxCpService.getExternalContactService().delJoinWay(configId);
}
@Test
public void testGetJoinWay() throws WxErrorException {
final String configId = "";
this.wxCpService.getExternalContactService().getJoinWay(configId);
}
}