Req-3117 修改钉钉调用接口

This commit is contained in:
zhongpeng 2024-11-21 11:46:41 +08:00
parent 23dd135b2d
commit 6dbd01e3eb
3 changed files with 7 additions and 6 deletions

View File

@ -18,8 +18,9 @@ public class DingDingSendRebootGroupMsgReq {
* 消息内容
* 目前支持SampleActionCard6其他待补充
* 其中的消息markdown格式的消息具体见https://open.dingtalk.com/document/orgapp/message-types-and-data-format#
* ReplyMessage的实现类并进行调用其toJson方法得到的字符串
*/
private ReplyMessage replyMessage;
private String dingDingJson;
/**
* 业务场景code,为了灵活支持多个消息发送此处直接采用字符串与nacos中的钉钉群配置一一对应

View File

@ -150,7 +150,6 @@ public class DingDingNewSdkManger {
public void sendGroupMessage(String accessToken, String rebootCode, String openConversationId, DingDingSendRebootGroupMsgReq req) {
com.aliyun.dingtalkrobot_1_0.models.OrgGroupSendHeaders orgGroupSendHeaders = new com.aliyun.dingtalkrobot_1_0.models.OrgGroupSendHeaders();
orgGroupSendHeaders.xAcsDingtalkAccessToken = accessToken;
com.aliyun.dingtalkrobot_1_0.models.OrgGroupSendRequest orgGroupSendRequest = new com.aliyun.dingtalkrobot_1_0.models.OrgGroupSendRequest();
@ -159,7 +158,7 @@ public class DingDingNewSdkManger {
orgGroupSendRequest.setOpenConversationId(openConversationId);
orgGroupSendRequest.setMsgKey(req.getMsgType().toString());
orgGroupSendRequest.setMsgParam(req.getReplyMessage().toJson());
orgGroupSendRequest.setMsgParam(req.getDingDingJson());
log.info("sendGroupMessage, orgGroupSendRequest={}accessToken={}", JSON.toJSONString(orgGroupSendRequest), accessToken);

View File

@ -38,11 +38,12 @@ public class DingDingMsgControllerTest extends BaseTest {
SampleActionCard6 sampleActionCard6 = new SampleActionCard6(title,text,buttonTitle1,buttonUrl1,buttonTitle2,buttonUrl2);
req.setReplyMessage(sampleActionCard6);
req.setDingDingJson(sampleActionCard6.toJson());
dingDingMsgController.sendRebootGroupMsg(req);
}
@Test
public void test2() {
@ -55,8 +56,8 @@ public class DingDingMsgControllerTest extends BaseTest {
String text = "内容 \n ## 标题1 你好";
SampleMarkdown sampleActionCard6 = new SampleMarkdown(title,text);
req.setReplyMessage(sampleActionCard6);
SampleMarkdown sampleMarkdown = new SampleMarkdown(title,text);
req.setDingDingJson(sampleMarkdown.toJson());
dingDingMsgController.sendRebootGroupMsg(req);
}