|
@@ -6,6 +6,7 @@ import de.codecentric.boot.admin.server.domain.entities.InstanceRepository;
|
|
|
import de.codecentric.boot.admin.server.domain.events.InstanceEvent;
|
|
|
import de.codecentric.boot.admin.server.notify.AbstractStatusChangeNotifier;
|
|
|
import java.util.Map;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import reactor.core.publisher.Mono;
|
|
|
|
|
|
/**
|
|
@@ -17,6 +18,8 @@ import reactor.core.publisher.Mono;
|
|
|
* @since 2022/3/31
|
|
|
**/
|
|
|
public class DingDingNotifier extends AbstractStatusChangeNotifier {
|
|
|
+ @Value("${send.dingTalk:0}")
|
|
|
+ public int sendDingTalk;
|
|
|
public DingDingNotifier(InstanceRepository repository) {
|
|
|
super(repository);
|
|
|
}
|
|
@@ -34,7 +37,9 @@ public class DingDingNotifier extends AbstractStatusChangeNotifier {
|
|
|
str.append("\n详情:" + JSONObject.toJSONString(details));
|
|
|
str.append("\nkeywords:aaa");
|
|
|
return Mono.fromRunnable(() -> {
|
|
|
- DingDingMessageUtil.sendTextMessage(str.toString());
|
|
|
+ if(sendDingTalk > 0){
|
|
|
+ DingDingMessageUtil.sendTextMessage(str.toString());
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
}
|