You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/01/12 06:39:59 UTC

[GitHub] [dolphinscheduler] zhuangchong commented on a change in pull request #7805: [Feature-7804][Task] DingTalk alert plugin adds signature.

zhuangchong commented on a change in pull request #7805:
URL: https://github.com/apache/dolphinscheduler/pull/7805#discussion_r782748498



##########
File path: dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-dingtalk/src/main/java/org/apache/dolphinscheduler/plugin/alert/dingtalk/DingTalkSender.java
##########
@@ -145,8 +159,18 @@ public AlertResult sendDingTalkMsg(String title, String content) {
 
     private String sendMsg(String title, String content) throws IOException {
 
-        String msgToJson = textToJsonString(title + content + "#" + keyword);
-        HttpPost httpPost = constructHttpPost(url, msgToJson);
+        StringBuilder text = new StringBuilder();
+        if (org.apache.dolphinscheduler.spi.utils.StringUtils.isNotBlank(keyword)) {
+            text.append(keyword);
+            text.append(":");
+        }
+        text.append(title);
+        text.append("\n");
+        text.append(content);
+
+        String msgToJson = textToJsonString(text.toString());

Review comment:
       No effect, the keyword is configured by DingTalk robot, as long as the text message contains it.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org