Quellcode durchsuchen

stater配置,增加自动装配类

zhangchenglong vor 2 Jahren
Ursprung
Commit
d1bb06e1a7
1 geänderte Dateien mit 9 neuen und 0 gelöschten Zeilen
  1. 9 0
      src/main/java/com/syjy/calculate/config/StarterAutoConfigure.java

+ 9 - 0
src/main/java/com/syjy/calculate/config/StarterAutoConfigure.java

@@ -1,5 +1,6 @@
 package com.syjy.calculate.config;
 package com.syjy.calculate.config;
 
 
+import com.syjy.calculate.listener.ApplicationListenerImpl;
 import com.syjy.calculate.repository.repositoryImpl.CalculationFormulaRepositoryImpl;
 import com.syjy.calculate.repository.repositoryImpl.CalculationFormulaRepositoryImpl;
 import com.syjy.calculate.service.AccuracyPassRateCalculateService;
 import com.syjy.calculate.service.AccuracyPassRateCalculateService;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
@@ -24,4 +25,12 @@ public class StarterAutoConfigure {
         return new CalculationFormulaRepositoryImpl();
         return new CalculationFormulaRepositoryImpl();
     }
     }
 
 
+    @Bean
+    @ConditionalOnMissingBean
+    @ConditionalOnProperty(prefix = "calculate.service", value = "enabled", havingValue = "true")
+    ApplicationListenerImpl applicationListenerImpl (){
+        return new ApplicationListenerImpl();
+    }
+
+
 }
 }