StartupRunner.java 554 B

123456789101112131415161718
  1. package com.malk.kabeiyi.config;
  2. import com.malk.kabeiyi.service.McProjectService;
  3. import org.springframework.beans.factory.annotation.Autowired;
  4. import org.springframework.boot.ApplicationArguments;
  5. import org.springframework.boot.ApplicationRunner;
  6. import org.springframework.stereotype.Component;
  7. @Component
  8. public class StartupRunner implements ApplicationRunner {
  9. @Autowired
  10. private McProjectService mcProjectService;
  11. @Override
  12. public void run(ApplicationArguments args) throws Exception {
  13. mcProjectService.init();
  14. }
  15. }