eight
2024-08-21 3c2ee852994cc3c4d861484f12d972b42cb0ffee
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/listener/MySpringEventListener.java
ÎļþÃû´Ó jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/MySpringEventLister.java ÐÞ¸Ä
@@ -1,21 +1,22 @@
package cn.lihu.jh.module.ecg;
package cn.lihu.jh.module.ecg.listener;
import cn.lihu.jh.module.ecg.service.queue.QueueService;
import org.springframework.boot.context.event.ApplicationStartedEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
@Component
public class MySpringEventLister implements ApplicationListener<ApplicationStartedEvent> {
public class MySpringEventListener {
    @Resource
    private QueueService queueService;
    @Override
    @EventListener
    public void onApplicationEvent(ApplicationStartedEvent event) {
        System.out.println("应用启动完成,通知监听器执行缓存预加载操作");
        queueService.initQueue();
        queueService.hurryup();
    }
}