ManageApplication.java 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. @Value("${fyun.bucket}")
  22. private String bucket;
  23. @Value("${camera.space.unit:GB}")
  24. private String cameraUnit;
  25. @Value("${camera.space.num:10737418240}")
  26. private String cameraSpaceNum;
  27. @Value("${camera.snCode.publicKey:1}")
  28. private String publicKey;
  29. @Value("${camera.snCode.privateKey:1}")
  30. private String privateKey;
  31. @Value("${laser.reg.env:UAT}")
  32. private String laserRegEnv;
  33. public static void main(String[] args) {
  34. SpringApplication.run(ManageApplication.class, args);
  35. }
  36. @Override
  37. public void run(String... args) throws Exception {
  38. CacheUtil.uploadType = uploadType;
  39. CacheUtil.bucket = bucket;
  40. CacheUtil.cameraUnit = cameraUnit;
  41. CacheUtil.cameraSpaceNum = cameraSpaceNum;
  42. CacheUtil.publicKey = publicKey;
  43. CacheUtil.privateKey = privateKey;
  44. CacheUtil.laserRegEnv = laserRegEnv;
  45. }
  46. }