Просмотр исходного кода

设置默认csv数据存储路径

wanggaokun 1 год назад
Родитель
Сommit
387aa18b72

+ 2 - 0
PHM-admin/phm-admin/src/main/resources/application.yml

@@ -10,6 +10,8 @@ phm:
   demoEnabled: true
   # 文件路径 示例( Windows配置D:/phm/uploadPath,Linux配置 /home/phm/uploadPath)
   profile: D:/phm/uploadPath
+  # 文件路径 示例( Windows配置D:/phm/dataPath/csv,Linux配置 /home/phm/dataPath/csv)
+  csvFile: D:/phm/dataPath/csv
   # 获取ip地址开关
   addressEnabled: false
   # 验证码类型 math 数字计算 char 字符验证

+ 11 - 56
PHM-admin/phm-common/src/main/java/com/phm/common/config/PHMConfig.java

@@ -3,6 +3,9 @@ package com.phm.common.config;
 import org.springframework.boot.context.properties.ConfigurationProperties;
 import org.springframework.stereotype.Component;
 
+import lombok.Data;
+import lombok.Getter;
+
 /**
  * 读取项目相关配置
  *
@@ -10,6 +13,7 @@ import org.springframework.stereotype.Component;
  */
 @Component
 @ConfigurationProperties(prefix = "phm")
+@Data
 public class PHMConfig {
     /**
      * 项目名称
@@ -34,8 +38,15 @@ public class PHMConfig {
     /**
      * 上传路径
      */
+    @Getter
     private static String profile;
 
+    /**
+     * csvFile上传路径
+     */
+    @Getter
+    private static String csvFile;
+
     /**
      * 获取地址开关
      */
@@ -46,62 +57,6 @@ public class PHMConfig {
      */
     private static String captchaType;
 
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public String getVersion() {
-        return version;
-    }
-
-    public void setVersion(String version) {
-        this.version = version;
-    }
-
-    public String getCopyrightYear() {
-        return copyrightYear;
-    }
-
-    public void setCopyrightYear(String copyrightYear) {
-        this.copyrightYear = copyrightYear;
-    }
-
-    public boolean isDemoEnabled() {
-        return demoEnabled;
-    }
-
-    public void setDemoEnabled(boolean demoEnabled) {
-        this.demoEnabled = demoEnabled;
-    }
-
-    public static String getProfile() {
-        return profile;
-    }
-
-    public void setProfile(String profile) {
-        PHMConfig.profile = profile;
-    }
-
-    public static boolean isAddressEnabled() {
-        return addressEnabled;
-    }
-
-    public void setAddressEnabled(boolean addressEnabled) {
-        PHMConfig.addressEnabled = addressEnabled;
-    }
-
-    public static String getCaptchaType() {
-        return captchaType;
-    }
-
-    public void setCaptchaType(String captchaType) {
-        PHMConfig.captchaType = captchaType;
-    }
-
     /**
      * 获取导入上传路径
      */