@@ -166,6 +166,12 @@ public void TestTemplateCardBuilder_text_notice() {
166
166
.value ("企业微信.apk" )
167
167
.media_id ("文件的media_id" )
168
168
.build ();
169
+ HorizontalContent hContent4 = HorizontalContent .builder ()
170
+ .type (3 )
171
+ .keyname ("员工信息" )
172
+ .value ("点击查看" )
173
+ .userid ("zhangsan" )
174
+ .build ();
169
175
170
176
TemplateCardJump jump1 = TemplateCardJump .builder ()
171
177
.type (1 )
@@ -178,25 +184,39 @@ public void TestTemplateCardBuilder_text_notice() {
178
184
.appid ("小程序的appid" )
179
185
.pagepath ("/index.html" )
180
186
.build ();
181
- QuoteArea quoteArea = QuoteArea .builder ()
187
+ QuoteArea quoteArea = QuoteArea .builder ()
182
188
.type (1 )
183
189
.title ("引用文献标题" )
184
190
.appid ("小程序的appid" )
185
191
.pagepath ("/index.html" )
186
192
.url ("https://work.weixin.qq.com" )
187
193
.quoteText ("引用文献样式的引用文案" )
188
194
.build ();
195
+ ActionMenuItem action1 = ActionMenuItem .builder ()
196
+ .text ("接受推送" )
197
+ .key ("A" )
198
+ .build ();
199
+ ActionMenuItem action2 = ActionMenuItem .builder ()
200
+ .text ("不再推送" )
201
+ .key ("B" )
202
+ .build ();
189
203
WxCpMessage reply = WxCpMessage .TEMPLATECARD ().toUser ("OPENID" )
204
+ .toParty ("PartyID1 | PartyID2" )
205
+ .toTag ("TagID1 | TagID2" )
190
206
.agentId (1000002 )
191
207
.cardType (WxConsts .TemplateCardType .TEXT_NOTICE )
208
+ .taskId ("task_id" )
192
209
.sourceIconUrl ("图片的url" )
193
210
.sourceDesc ("企业微信" )
211
+ .sourceDescColor (1 )
212
+ .actionMenuDesc ("卡片副交互辅助文本说明" )
213
+ .actionMenuActionList (Arrays .asList (action1 , action2 ))
194
214
.mainTitleTitle ("欢迎使用企业微信" )
195
215
.mainTitleDesc ("您的好友正在邀请您加入企业微信" )
196
216
.emphasisContentTitle ("100" )
197
217
.emphasisContentDesc ("核心数据" )
198
218
.subTitleText ("下载企业微信还能抢红包!" )
199
- .horizontalContents (Arrays .asList (hContent1 ,hContent2 ,hContent3 ))
219
+ .horizontalContents (Arrays .asList (hContent1 , hContent2 , hContent3 , hContent4 ))
200
220
.jumps (Arrays .asList (jump1 ,jump2 ))
201
221
.cardActionType (2 )
202
222
.cardActionAppid ("小程序的appid" )
@@ -209,8 +229,7 @@ public void TestTemplateCardBuilder_text_notice() {
209
229
reply .setDuplicateCheckInterval (1800 );
210
230
// System.out.println(reply.toJson());
211
231
assertThat (reply .toJson ())
212
- .isEqualTo ("{\" agentid\" :1000002,\" touser\" :\" OPENID\" ,\" msgtype\" :\" template_card\" ,\" duplicate_check_interval\" :1800,\" template_card\" :{\" card_type\" :\" text_notice\" ,\" source\" :{\" icon_url\" :\" 图片的url\" ,\" desc\" :\" 企业微信\" },\" main_title\" :{\" title\" :\" 欢迎使用企业微信\" ,\" desc\" :\" 您的好友正在邀请您加入企业微信\" },\" emphasis_content\" :{\" title\" :\" 100\" ,\" desc\" :\" 核心数据\" },\" sub_title_text\" :\" 下载企业微信还能抢红包!\" ,\" horizontal_content_list\" :[{\" keyname\" :\" 邀请人\" ,\" value\" :\" 张三\" },{\" type\" :1,\" keyname\" :\" 企业微信官网\" ,\" value\" :\" 点击访问\" ,\" url\" :\" https://work.weixin.qq.com\" },{\" type\" :2,\" keyname\" :\" 企业微信下载\" ,\" value\" :\" 企业微信.apk\" ,\" media_id\" :\" 文件的media_id\" }],\" jump_list\" :[{\" type\" :1,\" title\" :\" 企业微信官网\" ,\" url\" :\" https://work.weixin.qq.com\" },{\" type\" :2,\" title\" :\" 跳转小程序\" ,\" appid\" :\" 小程序的appid\" ,\" pagepath\" :\" /index.html\" }],\" card_action\" :{\" type\" :2,\" url\" :\" https://work.weixin.qq.com\" ,\" appid\" :\" 小程序的appid\" ,\" pagepath\" :\" /index.html\" },\" quote_area\" :{\" type\" :1,\" url\" :\" https://work.weixin.qq.com\" ,\" appid\" :\" 小程序的appid\" ,\" pagepath\" :\" /index.html\" ,\" title\" :\" 引用文献标题\" ,\" quote_text\" :\" 引用文献样式的引用文案\" }}}" );
213
-
232
+ .isEqualTo ("{\" agentid\" :1000002,\" touser\" :\" OPENID\" ,\" msgtype\" :\" template_card\" ,\" toparty\" :\" PartyID1 | PartyID2\" ,\" totag\" :\" TagID1 | TagID2\" ,\" duplicate_check_interval\" :1800,\" template_card\" :{\" card_type\" :\" text_notice\" ,\" source\" :{\" icon_url\" :\" 图片的url\" ,\" desc\" :\" 企业微信\" ,\" desc_color\" :1},\" action_menu\" :{\" desc\" :\" 卡片副交互辅助文本说明\" ,\" action_list\" :[{\" text\" :\" 接受推送\" ,\" key\" :\" A\" },{\" text\" :\" 不再推送\" ,\" key\" :\" B\" }]},\" main_title\" :{\" title\" :\" 欢迎使用企业微信\" ,\" desc\" :\" 您的好友正在邀请您加入企业微信\" },\" emphasis_content\" :{\" title\" :\" 100\" ,\" desc\" :\" 核心数据\" },\" sub_title_text\" :\" 下载企业微信还能抢红包!\" ,\" task_id\" :\" task_id\" ,\" horizontal_content_list\" :[{\" keyname\" :\" 邀请人\" ,\" value\" :\" 张三\" },{\" type\" :1,\" keyname\" :\" 企业微信官网\" ,\" value\" :\" 点击访问\" ,\" url\" :\" https://work.weixin.qq.com\" },{\" type\" :2,\" keyname\" :\" 企业微信下载\" ,\" value\" :\" 企业微信.apk\" ,\" media_id\" :\" 文件的media_id\" },{\" type\" :3,\" keyname\" :\" 员工信息\" ,\" value\" :\" 点击查看\" ,\" userid\" :\" zhangsan\" }],\" jump_list\" :[{\" type\" :1,\" title\" :\" 企业微信官网\" ,\" url\" :\" https://work.weixin.qq.com\" },{\" type\" :2,\" title\" :\" 跳转小程序\" ,\" appid\" :\" 小程序的appid\" ,\" pagepath\" :\" /index.html\" }],\" card_action\" :{\" type\" :2,\" url\" :\" https://work.weixin.qq.com\" ,\" appid\" :\" 小程序的appid\" ,\" pagepath\" :\" /index.html\" },\" quote_area\" :{\" type\" :1,\" url\" :\" https://work.weixin.qq.com\" ,\" appid\" :\" 小程序的appid\" ,\" pagepath\" :\" /index.html\" ,\" title\" :\" 引用文献标题\" ,\" quote_text\" :\" 引用文献样式的引用文案\" }}}" );
214
233
}
215
234
216
235
/**
@@ -404,13 +423,13 @@ public void TestTemplateCardBuilder_multiple_interaction() {
404
423
.question_key ("question_key1" )
405
424
.title ("选择器标签1" )
406
425
.selected_id ("selection_id1" )
407
- .options (Arrays .asList (option1 ,option2 ))
426
+ .options (Arrays .asList (option1 , option2 ))
408
427
.build ();
409
428
MultipleSelect mSelect2 = MultipleSelect .builder ()
410
429
.question_key ("question_key2" )
411
430
.title ("选择器标签2" )
412
431
.selected_id ("selection_id3" )
413
- .options (Arrays .asList (option3 ,option4 ))
432
+ .options (Arrays .asList (option3 , option4 ))
414
433
.build ();
415
434
416
435
0 commit comments