AyaoJiesConfig.java 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. package cn.com.ayaojies.common.config;
  2. import org.springframework.boot.context.properties.ConfigurationProperties;
  3. import org.springframework.stereotype.Component;
  4. /**
  5. * 读取项目相关配置
  6. *
  7. * @author AyaoJies
  8. */
  9. @Component
  10. @ConfigurationProperties(prefix = "ayaojies")
  11. public class AyaoJiesConfig {
  12. /**
  13. * 上传路径
  14. */
  15. private static String profile;
  16. /**
  17. * 获取地址开关
  18. */
  19. private static boolean addressEnabled;
  20. /**
  21. * 验证码类型
  22. */
  23. private static String captchaType;
  24. /**
  25. * 项目名称
  26. */
  27. private String name;
  28. /**
  29. * 版本
  30. */
  31. private String version;
  32. /**
  33. * 版权年份
  34. */
  35. private String copyrightYear;
  36. /**
  37. * 实例演示开关
  38. */
  39. private boolean demoEnabled;
  40. public static String getProfile() {
  41. return profile;
  42. }
  43. public void setProfile(String profile) {
  44. AyaoJiesConfig.profile = profile;
  45. }
  46. public static boolean isAddressEnabled() {
  47. return addressEnabled;
  48. }
  49. public void setAddressEnabled(boolean addressEnabled) {
  50. AyaoJiesConfig.addressEnabled = addressEnabled;
  51. }
  52. public static String getCaptchaType() {
  53. return captchaType;
  54. }
  55. public void setCaptchaType(String captchaType) {
  56. AyaoJiesConfig.captchaType = captchaType;
  57. }
  58. /**
  59. * 获取导入上传路径
  60. */
  61. public static String getImportPath() {
  62. return getProfile() + "/import";
  63. }
  64. /**
  65. * 获取头像上传路径
  66. */
  67. public static String getAvatarPath() {
  68. return getProfile() + "/avatar";
  69. }
  70. /**
  71. * 获取下载路径
  72. */
  73. public static String getDownloadPath() {
  74. return getProfile() + "/download/";
  75. }
  76. /**
  77. * 获取上传路径
  78. */
  79. public static String getUploadPath() {
  80. return getProfile() + "/upload";
  81. }
  82. public String getName() {
  83. return name;
  84. }
  85. public void setName(String name) {
  86. this.name = name;
  87. }
  88. public String getVersion() {
  89. return version;
  90. }
  91. public void setVersion(String version) {
  92. this.version = version;
  93. }
  94. public String getCopyrightYear() {
  95. return copyrightYear;
  96. }
  97. public void setCopyrightYear(String copyrightYear) {
  98. this.copyrightYear = copyrightYear;
  99. }
  100. public boolean isDemoEnabled() {
  101. return demoEnabled;
  102. }
  103. public void setDemoEnabled(boolean demoEnabled) {
  104. this.demoEnabled = demoEnabled;
  105. }
  106. }