|
@@ -0,0 +1,26 @@
|
|
|
|
+package com.zswl.cloud.springBtach.server.core.config;
|
|
|
|
+
|
|
|
|
+import com.github.microservice.components.data.mongo.timer.config.TaskTimerConfiguration;
|
|
|
|
+import com.github.microservice.components.data.mongo.timer.event.SimpleTaskTimerEvent;
|
|
|
|
+import com.zswl.cloud.springBtach.server.core.domain.ScheduledTask;
|
|
|
|
+import com.zswl.cloud.springBtach.server.core.task.TaskTimerEvent;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.context.annotation.Configuration;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * 任务定时器的配置
|
|
|
|
+ */
|
|
|
|
+@Configuration
|
|
|
|
+public class SimpleTaskTimerConfig extends TaskTimerConfiguration {
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private TaskTimerEvent taskTimerEvent;
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public TaskTimerItem[] register() {
|
|
|
|
+ return new TaskTimerItem[]{
|
|
|
|
+ TaskTimerItem.builder().taskTimerTable(ScheduledTask.class).taskTimerEvent(taskTimerEvent).build()
|
|
|
|
+
|
|
|
|
+ };
|
|
|
|
+ }
|
|
|
|
+}
|