del 删除无用依赖
This commit is contained in:
parent
e74f0ca6f8
commit
e25083aea4
@ -39,11 +39,6 @@
|
|||||||
<artifactId>lombok</artifactId>
|
<artifactId>lombok</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.dromara</groupId>
|
|
||||||
<artifactId>ruoyi-common-core</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
@ -1,44 +0,0 @@
|
|||||||
package org.dromara.monitor.admin.event;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.io.Serial;
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通知事件
|
|
||||||
*
|
|
||||||
* @author AprilWind
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class NotifierEvent implements Serializable {
|
|
||||||
|
|
||||||
@Serial
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 实例注册名称
|
|
||||||
*/
|
|
||||||
private String registName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 实例状态名称
|
|
||||||
*/
|
|
||||||
private String statusName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 实例ID
|
|
||||||
*/
|
|
||||||
private String instanceId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 实例状态
|
|
||||||
*/
|
|
||||||
private String status;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 服务URL
|
|
||||||
*/
|
|
||||||
private String serviceUrl;
|
|
||||||
|
|
||||||
}
|
|
@ -6,8 +6,6 @@ import de.codecentric.boot.admin.server.domain.events.InstanceEvent;
|
|||||||
import de.codecentric.boot.admin.server.domain.events.InstanceStatusChangedEvent;
|
import de.codecentric.boot.admin.server.domain.events.InstanceStatusChangedEvent;
|
||||||
import de.codecentric.boot.admin.server.notify.AbstractEventNotifier;
|
import de.codecentric.boot.admin.server.notify.AbstractEventNotifier;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dromara.common.core.utils.SpringUtils;
|
|
||||||
import org.dromara.monitor.admin.event.NotifierEvent;
|
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import reactor.core.publisher.Mono;
|
import reactor.core.publisher.Mono;
|
||||||
|
|
||||||
@ -51,13 +49,6 @@ public class CustomNotifier extends AbstractEventNotifier {
|
|||||||
};
|
};
|
||||||
log.info("Instance Status Change: 状态名称【{}】, 注册名称【{}】, 实例ID【{}】, 状态【{}】, 服务URL【{}】",
|
log.info("Instance Status Change: 状态名称【{}】, 注册名称【{}】, 实例ID【{}】, 状态【{}】, 服务URL【{}】",
|
||||||
statusName, registName, instanceId, status, serviceUrl);
|
statusName, registName, instanceId, status, serviceUrl);
|
||||||
NotifierEvent notifier = new NotifierEvent();
|
|
||||||
notifier.setRegistName(registName);
|
|
||||||
notifier.setStatusName(statusName);
|
|
||||||
notifier.setInstanceId(instanceId);
|
|
||||||
notifier.setStatus(status);
|
|
||||||
notifier.setServiceUrl(serviceUrl);
|
|
||||||
SpringUtils.context().publishEvent(notifier);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1,34 +0,0 @@
|
|||||||
package org.dromara.monitor.admin.notifier;
|
|
||||||
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.dromara.monitor.admin.event.NotifierEvent;
|
|
||||||
import org.springframework.context.event.EventListener;
|
|
||||||
import org.springframework.scheduling.annotation.Async;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 信息通知
|
|
||||||
*
|
|
||||||
* @author AprilWind
|
|
||||||
*/
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
@Slf4j
|
|
||||||
@Service
|
|
||||||
public class InfoNotifier {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 异步处理通知事件的方法
|
|
||||||
* <p>
|
|
||||||
* 该方法会处理 `NotifierEvent` 事件,执行通知相关的操作,如发送邮件或短信
|
|
||||||
*
|
|
||||||
* @param notifier 事件对象,包含了需要通知的详细信息,包括注册名称、状态名称、实例 ID、状态和服务 URL
|
|
||||||
*/
|
|
||||||
@Async
|
|
||||||
@EventListener
|
|
||||||
public void infoNotification(NotifierEvent notifier) {
|
|
||||||
// 在这里添加处理通知事件的逻辑
|
|
||||||
// 例如,依据 notifier 对象的信息发送邮件或短信通知
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user