fix:1、openid必填改为选填
2、webhuook url跟larkUrl对象解析错误,null
This commit is contained in:
parent
bae140a3a8
commit
65bea3457a
@ -11,7 +11,7 @@ import java.util.List;
|
||||
@Data
|
||||
public class DingDingAttribute {
|
||||
|
||||
private String dingDingUrl;
|
||||
private String webhookUrl;
|
||||
|
||||
private List<String> ats;
|
||||
|
||||
|
@ -14,7 +14,7 @@ import java.util.List;
|
||||
@Data
|
||||
public class LarkAttribute {
|
||||
|
||||
private String larkUrl;
|
||||
private String webhookUrl;
|
||||
|
||||
private List<String> ats;
|
||||
|
||||
|
@ -26,7 +26,7 @@ public class DingdingAlarm extends AbstractAlarm<AlarmContext> {
|
||||
|
||||
DingDingAttribute dingDingAttribute = JsonUtil.parseObject(context.getNotifyAttribute(), DingDingAttribute.class);
|
||||
threadPoolExecutor.execute(() ->
|
||||
DingDingUtils.sendMessage(DingDingUtils.buildSendRequest(context.getTitle(), context.getText(),dingDingAttribute.getAts(),dingDingAttribute.isAtAll()), dingDingAttribute.getDingDingUrl()));
|
||||
DingDingUtils.sendMessage(DingDingUtils.buildSendRequest(context.getTitle(), context.getText(),dingDingAttribute.getAts(),dingDingAttribute.isAtAll()), dingDingAttribute.getWebhookUrl()));
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -34,7 +34,7 @@ public class DingdingAlarm extends AbstractAlarm<AlarmContext> {
|
||||
@Override
|
||||
public boolean syncSendMessage(AlarmContext context) {
|
||||
DingDingAttribute dingDingAttribute = JsonUtil.parseObject(context.getNotifyAttribute(), DingDingAttribute.class);
|
||||
return DingDingUtils.sendMessage(DingDingUtils.buildSendRequest(context.getTitle(), context.getText(),dingDingAttribute.getAts(),dingDingAttribute.isAtAll()), dingDingAttribute.getDingDingUrl());
|
||||
return DingDingUtils.sendMessage(DingDingUtils.buildSendRequest(context.getTitle(), context.getText(),dingDingAttribute.getAts(),dingDingAttribute.isAtAll()), dingDingAttribute.getWebhookUrl());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -63,7 +63,7 @@ public class LarkAlarm extends AbstractAlarm<AlarmContext> {
|
||||
.card(map).build();
|
||||
|
||||
try {
|
||||
HttpRequest post = HttpUtil.createPost(larkAttribute.getLarkUrl());
|
||||
HttpRequest post = HttpUtil.createPost(larkAttribute.getWebhookUrl());
|
||||
HttpRequest request = post.body(JsonUtil.toJsonString(builder), ContentType.JSON.toString());
|
||||
HttpResponse execute = request.execute();
|
||||
LogUtils.debug(log, JsonUtil.toJsonString(execute));
|
||||
|
@ -163,14 +163,14 @@
|
||||
]" />
|
||||
</a-form-item>
|
||||
<a-form-item v-if="this.notifyTypeValue === '1'">
|
||||
<span slot="label">被@人手机号 <a :href="officialWebsite + '/pages/32e4a0/#被@人手机号是何物' +''" target="_blank"> <a-icon type="question-circle-o" /></a></span>
|
||||
<span slot="label">被@人手机号或钉钉号 <a :href="officialWebsite + '/pages/32e4a0/#被被@人手机号或钉钉号是何物' +''" target="_blank"> <a-icon type="question-circle-o" /></a></span>
|
||||
<a-input
|
||||
placeholder="请输入被@人手机号"
|
||||
placeholder="请输入被@人手机号或钉钉号"
|
||||
type="textarea"
|
||||
v-if="this.notifyTypeValue === '1'"
|
||||
v-decorator="[
|
||||
'ats',
|
||||
{rules: [{ required: true, message: '请输入被@人手机号', whitespace: true}]}
|
||||
{rules: [{ required: false, message: '请输入被@人手机号或钉钉号', whitespace: true}]}
|
||||
]" />
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
@ -192,7 +192,7 @@
|
||||
v-if="this.notifyTypeValue === '4'"
|
||||
v-decorator="[
|
||||
'ats',
|
||||
{rules: [{ required: true, message: '请输入被@人open_id', whitespace: true}]}
|
||||
{rules: [{ required: false, message: '请输入被@人open_id', whitespace: true}]}
|
||||
]" />
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
@ -474,11 +474,11 @@ export default {
|
||||
if (this.notifyTypeValue === '1') {
|
||||
s =
|
||||
'钉钉Url:' + json['webhookUrl'] + ';' +
|
||||
'被@人手机号:' + json['ats'] + ';'
|
||||
'被@人手机号或钉钉号:' + json['ats'] + ';'
|
||||
} else if (this.notifyTypeValue === '4') {
|
||||
s =
|
||||
'飞书Url:' + json['webhookUrl'] + ';' +
|
||||
'被@人用户id:' + json['ats'] + ';'
|
||||
'被@人openid:' + json['ats'] + ';'
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user