ManageApplication.java 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. package com.fdkankan.manage;
  2. import com.fdkankan.manage.common.CacheUtil;
  3. import org.mybatis.spring.annotation.MapperScan;
  4. import org.springframework.beans.factory.annotation.Value;
  5. import org.springframework.boot.CommandLineRunner;
  6. import org.springframework.boot.SpringApplication;
  7. import org.springframework.boot.autoconfigure.SpringBootApplication;
  8. import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
  9. import org.springframework.context.annotation.ComponentScan;
  10. import org.springframework.scheduling.annotation.EnableScheduling;
  11. import org.springframework.transaction.annotation.EnableTransactionManagement;
  12. @SpringBootApplication
  13. @EnableTransactionManagement//开启事务
  14. @EnableDiscoveryClient
  15. @EnableScheduling
  16. @ComponentScan(basePackages = {"com.fdkankan.*"})
  17. @MapperScan("com.fdkankan.**.mapper")
  18. public class ManageApplication implements CommandLineRunner {
  19. @Value("${fyun.type}")
  20. private String uploadType;
  21. public static void main(String[] args) {
  22. SpringApplication.run(ManageApplication.class, args);
  23. }
  24. @Override
  25. public void run(String... args) throws Exception {
  26. CacheUtil.uploadType = uploadType;
  27. }
  28. }