RailwayConfig.java 949 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. package com.railway.common.config;
  2. import lombok.Data;
  3. import org.springframework.boot.context.properties.ConfigurationProperties;
  4. import org.springframework.stereotype.Component;
  5. /**
  6. * 全局配置类
  7. *
  8. * @author railway
  9. */
  10. @Data
  11. @Component
  12. @ConfigurationProperties(prefix = "railway")
  13. public class RailwayConfig {
  14. /**
  15. * 项目名称
  16. */
  17. private String name;
  18. /**
  19. * 版本
  20. */
  21. private String version;
  22. /**
  23. * 版权年份
  24. */
  25. private String copyrightYear;
  26. private static String filePath;
  27. /**
  28. * 获取地址开关
  29. */
  30. private static boolean addressEnabled;
  31. public static boolean isAddressEnabled() {
  32. return addressEnabled;
  33. }
  34. public void setAddressEnabled(boolean addressEnabled) {
  35. RailwayConfig.addressEnabled = addressEnabled;
  36. }
  37. public static String getFilePath() {
  38. return filePath;
  39. }
  40. public void setFilePath(String filePath){
  41. RailwayConfig.filePath = filePath;
  42. }
  43. }