mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-19 09:55:16 +08:00
fix 追加关键词到标题中
This commit is contained in:
parent
4408206d48
commit
4fad76397a
@ -70,6 +70,11 @@ public class NotifyProperties {
|
|||||||
*/
|
*/
|
||||||
private String secret;
|
private String secret;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关键词
|
||||||
|
*/
|
||||||
|
private String keywords;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Post地址
|
* Post地址
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -6,7 +6,6 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.common.mail.utils.MailUtils;
|
import org.dromara.common.mail.utils.MailUtils;
|
||||||
|
|
||||||
import org.dromara.monitor.admin.config.properties.NotifyProperties;
|
import org.dromara.monitor.admin.config.properties.NotifyProperties;
|
||||||
import org.dromara.monitor.admin.event.NotifierEvent;
|
import org.dromara.monitor.admin.event.NotifierEvent;
|
||||||
import org.springframework.context.event.EventListener;
|
import org.springframework.context.event.EventListener;
|
||||||
@ -94,6 +93,10 @@ public class InfoNotifier {
|
|||||||
String title = notifier.getRegistName() + notifier.getStatusName();
|
String title = notifier.getRegistName() + notifier.getStatusName();
|
||||||
String message = StringUtils.format(webHook.getTemplate(), title,
|
String message = StringUtils.format(webHook.getTemplate(), title,
|
||||||
notifier.getRegistName(), notifier.getInstanceId(), notifier.getStatus(), notifier.getServiceUrl());
|
notifier.getRegistName(), notifier.getInstanceId(), notifier.getStatus(), notifier.getServiceUrl());
|
||||||
|
if (StringUtils.isNotBlank(webHook.getKeywords())) {
|
||||||
|
//追加关键词到标题中
|
||||||
|
title += "——" + webHook.getKeywords();
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
sendWebHookMessage(webHook, title, message);
|
sendWebHookMessage(webHook, title, message);
|
||||||
log.info("WebHook消息已发送至: {}", webHook.getUrl());
|
log.info("WebHook消息已发送至: {}", webHook.getUrl());
|
||||||
|
|||||||
@ -85,6 +85,7 @@ notify:
|
|||||||
type: 0
|
type: 0
|
||||||
url:
|
url:
|
||||||
secret:
|
secret:
|
||||||
|
keywords:
|
||||||
template: |
|
template: |
|
||||||
### {}通知
|
### {}通知
|
||||||
- **服务名**: {}
|
- **服务名**: {}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user