Req-3117 修改钉钉调用接口
This commit is contained in:
parent
23dd135b2d
commit
6dbd01e3eb
@ -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中的钉钉群配置一一对应
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user