Commit c9fe01bb authored by zhu-mingye's avatar zhu-mingye

Add @mobile mode of dingTalk Alert

parent 55e50632
...@@ -168,6 +168,7 @@ public class DingTalkSender { ...@@ -168,6 +168,7 @@ public class DingTalkSender {
builder.append(" "); builder.append(" ");
}); });
} }
builder.append("\n\n");
String txt = genrateResultMsg(title, content, builder); String txt = genrateResultMsg(title, content, builder);
text.put("title", title); text.put("title", title);
text.put("text", txt); text.put("text", txt);
...@@ -226,9 +227,13 @@ public class DingTalkSender { ...@@ -226,9 +227,13 @@ public class DingTalkSender {
String[] atMobileArray = Asserts.isNotNullString(atMobiles) ? atMobiles.split(",") : new String[0]; String[] atMobileArray = Asserts.isNotNullString(atMobiles) ? atMobiles.split(",") : new String[0];
String[] atUserArray = Asserts.isNotNullString(atUserIds) ? atUserIds.split(",") : new String[0]; String[] atUserArray = Asserts.isNotNullString(atUserIds) ? atUserIds.split(",") : new String[0];
boolean isAtAll = Objects.isNull(atAll) ? false : atAll; boolean isAtAll = Objects.isNull(atAll) ? false : atAll;
at.put("atMobiles", atMobileArray);
at.put("atUserIds", atUserArray);
at.put("isAtAll", isAtAll); at.put("isAtAll", isAtAll);
if (atMobileArray.length > 0){
at.put("atMobiles", atMobileArray);
}
if (atMobileArray.length > 0){
at.put("atUserIds", atUserArray);
}
items.put("at", at); items.put("at", at);
} }
......
...@@ -119,6 +119,18 @@ const DingTalkForm: React.FC<AlertInstanceFormProps> = (props) => { ...@@ -119,6 +119,18 @@ const DingTalkForm: React.FC<AlertInstanceFormProps> = (props) => {
<Switch checkedChildren="启用" unCheckedChildren="禁用" <Switch checkedChildren="启用" unCheckedChildren="禁用"
defaultChecked={vals.isAtAll}/> defaultChecked={vals.isAtAll}/>
</Form.Item> </Form.Item>
{vals.isAtAll ? undefined :
<>
<Form.Item
name="atMobiles"
label="@手机号"
rules={[{required: true, message: '请输入@手机号!'}]}
>
<Input placeholder="请输入@手机号 多个使用英文逗号分开 "/>
</Form.Item>
</>
}
<Form.Item <Form.Item
name="enabled" name="enabled"
label="是否启用"> label="是否启用">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment