1
0
mirror of synced 2025-12-28 05:57:57 +08:00

#1075 企业微信支持推送小程序通知消息

This commit is contained in:
Binary Wang
2019-06-16 21:35:18 +08:00
parent cb4e3f3eb0
commit a4f5aa341b
4 changed files with 144 additions and 12 deletions

View File

@@ -1,5 +1,6 @@
package me.chanjar.weixin.cp.api;
import com.google.common.collect.ImmutableMap;
import org.testng.annotations.*;
import com.google.inject.Inject;
@@ -107,4 +108,27 @@ public class WxCpMessageAPITest {
System.out.println(messageSendResult.getInvalidUserList());
System.out.println(messageSendResult.getInvalidTagList());
}
@Test
public void testSendMessage_miniprogram_notice() throws WxErrorException {
WxCpMessage message = WxCpMessage
.newMiniProgramNoticeBuilder()
.toUser(configStorage.getUserId())
.appId("wx123123123123123")
.page("pages/index?userid=zhangsan&orderid=123123123")
.title("会议室预订成功通知")
.description("4月27日 16:16")
.emphasisFirstItem(true)
.contentItems(ImmutableMap.of("会议室","402",
"会议地点","广州TIT-402会议室",
"会议时间","2018年8月1日 09:00-09:30"))
.build();
WxCpMessageSendResult messageSendResult = this.wxService.messageSend(message);
assertNotNull(messageSendResult);
System.out.println(messageSendResult);
System.out.println(messageSendResult.getInvalidPartyList());
System.out.println(messageSendResult.getInvalidUserList());
System.out.println(messageSendResult.getInvalidTagList());
}
}