1
0
mirror of synced 2026-02-27 17:02:55 +08:00

🎨 #2155 【企业微信】发送新客户欢迎语接口增加对视频类型的支持,同时修复结构不正确的问题

This commit is contained in:
pg
2021-06-21 11:58:13 +08:00
committed by GitHub
parent 8e0a6a3d40
commit 566e5f31c7
5 changed files with 135 additions and 9 deletions

View File

@@ -8,6 +8,9 @@ import me.chanjar.weixin.cp.api.WxCpService;
import me.chanjar.weixin.cp.bean.WxCpBaseResp;
import me.chanjar.weixin.cp.bean.external.*;
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.time.DateFormatUtils;
import org.testng.annotations.Guice;
import org.testng.annotations.Test;
@@ -214,8 +217,22 @@ public class WxCpExternalContactServiceImplTest {
@Test
public void testSendWelcomeMsg() throws WxErrorException {
Image image = new Image();
image.setMediaId("123123");
Attachment attachment = new Attachment();
attachment.setImage(image);
Video video = new Video();
video.setMediaId("video_media_id");
Attachment attachment2 = new Attachment();
attachment2.setVideo(video);
List<Attachment> attachments = new ArrayList<>();
attachments.add(attachment);
attachments.add(attachment2);
this.wxCpService.getExternalContactService().sendWelcomeMsg(WxCpWelcomeMsg.builder()
.welcomeCode("abc")
.attachments(attachments)
.build());
}