lvzhiqiang 2 月之前
父节点
当前提交
5c2ab4352c

+ 2 - 0
src/main/java/top/lvzhiqiang/App.java

@@ -4,10 +4,12 @@ import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.scheduling.annotation.EnableAsync;
 import org.springframework.scheduling.annotation.EnableAsync;
+import top.lvzhiqiang.config.EnableXXLJob;
 
 
 @MapperScan(basePackages = "top.lvzhiqiang.mapper")
 @MapperScan(basePackages = "top.lvzhiqiang.mapper")
 @SpringBootApplication
 @SpringBootApplication
 @EnableAsync
 @EnableAsync
+@EnableXXLJob
 public class App {
 public class App {
     public static void main(String[] args) {
     public static void main(String[] args) {
         SpringApplication.run(App.class, args);
         SpringApplication.run(App.class, args);

+ 3 - 4
src/main/java/top/lvzhiqiang/config/XXLJobAutoConfiguration.java

@@ -1,7 +1,6 @@
 package top.lvzhiqiang.config;
 package top.lvzhiqiang.config;
 
 
 import com.xxl.job.core.executor.impl.XxlJobSpringExecutor;
 import com.xxl.job.core.executor.impl.XxlJobSpringExecutor;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.context.annotation.Configuration;
 
 
@@ -12,7 +11,7 @@ import org.springframework.context.annotation.Configuration;
  * 2022/3/13 12:40
  * 2022/3/13 12:40
  */
  */
 @Configuration
 @Configuration
-@ConditionalOnBean(XXLJobMarkerConfiguration.Marker.class)
+//@ConditionalOnBean(XXLJobMarkerConfiguration.Marker.class)
 public class XXLJobAutoConfiguration {
 public class XXLJobAutoConfiguration {
     /**
     /**
      * 设置XXL-JOB定时任务属性值
      * 设置XXL-JOB定时任务属性值
@@ -20,7 +19,7 @@ public class XXLJobAutoConfiguration {
      * @return com.riskraider.config.job.XXLJobProperties
      * @return com.riskraider.config.job.XXLJobProperties
      * @author shiyong
      * @author shiyong
      * 2022/3/13 12:49
      * 2022/3/13 12:49
-    */
+     */
     @Bean
     @Bean
     public XXLJobProperties xxlJobProperties() {
     public XXLJobProperties xxlJobProperties() {
         return new XXLJobProperties();
         return new XXLJobProperties();
@@ -33,7 +32,7 @@ public class XXLJobAutoConfiguration {
      * @return com.xxl.job.core.executor.impl.XxlJobSpringExecutor
      * @return com.xxl.job.core.executor.impl.XxlJobSpringExecutor
      * @author shiyong
      * @author shiyong
      * 2022/3/13 12:57
      * 2022/3/13 12:57
-    */
+     */
     @Bean
     @Bean
     public XxlJobSpringExecutor xxlJobExecutor(XXLJobProperties xxlJobProperties) {
     public XxlJobSpringExecutor xxlJobExecutor(XXLJobProperties xxlJobProperties) {
         XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor();
         XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor();