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



##########
File path: 
dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-dingtalk/src/main/java/org/apache/dolphinscheduler/plugin/alert/dingtalk/DingTalkParamsConstants.java
##########
@@ -27,6 +27,9 @@
     static final String DING_TALK_KEYWORD = "$t('keyword')";
     static final String NAME_DING_TALK_KEYWORD = "Keyword";
 
+    static final String DING_TALK_SECRET = "$t('secret')";
+    static final String NAME_DING_TALK_SECRET = "secret";

Review comment:
       ```suggestion
       static final String NAME_DING_TALK_SECRET = "Secret";
   ```

##########
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:
       Does the order make a difference?




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to