فهرست منبع

stater配置,增加自动装配类

zhangchenglong 2 سال پیش
والد
کامیت
d1bb06e1a7
1فایلهای تغییر یافته به همراه9 افزوده شده و 0 حذف شده
  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;
 
+import com.syjy.calculate.listener.ApplicationListenerImpl;
 import com.syjy.calculate.repository.repositoryImpl.CalculationFormulaRepositoryImpl;
 import com.syjy.calculate.service.AccuracyPassRateCalculateService;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
@@ -24,4 +25,12 @@ public class StarterAutoConfigure {
         return new CalculationFormulaRepositoryImpl();
     }
 
+    @Bean
+    @ConditionalOnMissingBean
+    @ConditionalOnProperty(prefix = "calculate.service", value = "enabled", havingValue = "true")
+    ApplicationListenerImpl applicationListenerImpl (){
+        return new ApplicationListenerImpl();
+    }
+
+
 }