From 322330cf1ea58aef1fbda03713ef8738e34c960a Mon Sep 17 00:00:00 2001 From: ruying408 <1877972603@qq.com> Date: Fri, 20 Sep 2024 23:22:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D:=E5=AE=9A=E6=97=B6=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1prod=E7=8E=AF=E5=A2=83=EF=BC=8C=E4=B8=8D=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=88=9D=E5=A7=8B=E5=8C=96=E4=BB=BB=E5=8A=A1=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/cool/modules/task/event/TaskEvent.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/cool/modules/task/event/TaskEvent.java b/src/main/java/com/cool/modules/task/event/TaskEvent.java index b43a638..0ce78a7 100644 --- a/src/main/java/com/cool/modules/task/event/TaskEvent.java +++ b/src/main/java/com/cool/modules/task/event/TaskEvent.java @@ -1,11 +1,10 @@ package com.cool.modules.task.event; -import com.cool.core.init.DBFromJsonInit; import com.cool.modules.task.service.TaskInfoService; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.springframework.boot.context.event.ApplicationReadyEvent; -import org.springframework.context.event.EventListener; +import org.springframework.boot.ApplicationArguments; +import org.springframework.boot.ApplicationRunner; import org.springframework.stereotype.Component; /** @@ -14,12 +13,12 @@ import org.springframework.stereotype.Component; @Slf4j @Component @RequiredArgsConstructor -public class TaskEvent { +public class TaskEvent implements ApplicationRunner { final private TaskInfoService taskInfoService; - @EventListener - public void handleDbInitCompleteEvent(DBFromJsonInit.DbInitCompleteEvent event) { + @Override + public void run(ApplicationArguments args) throws Exception { taskInfoService.init(); log.info("初始化任务"); }