中国算力平台算力登记系统2.0
yanzhaofeige
3 days ago 9a224d216652ef2d6ff2e0bd01fba69c86a3f277
commit | author | age
43dc29 1 package com.odcc.cpzidc.common.config;
Y 2
3 import org.springframework.boot.context.properties.ConfigurationProperties;
4 import org.springframework.stereotype.Component;
5
6 /**
7  * 读取项目相关配置
8  * 
9  * @author ruoyi
10  */
11 @Component
f21d30 12 @ConfigurationProperties(prefix = "cpzidc")
Y 13 public class CpzIdcConfig
43dc29 14 {
Y 15     /** 项目名称 */
16     private String name;
17
18     /** 版本 */
19     private String version;
20
21     /** 版权年份 */
22     private String copyrightYear;
23
24     /** 上传路径 */
25     private static String profile;
26
27     /** 获取地址开关 */
28     private static boolean addressEnabled;
29
30     /** 验证码类型 */
31     private static String captchaType;
32
33     public String getName()
34     {
35         return name;
36     }
37
38     public void setName(String name)
39     {
40         this.name = name;
41     }
42
43     public String getVersion()
44     {
45         return version;
46     }
47
48     public void setVersion(String version)
49     {
50         this.version = version;
51     }
52
53     public String getCopyrightYear()
54     {
55         return copyrightYear;
56     }
57
58     public void setCopyrightYear(String copyrightYear)
59     {
60         this.copyrightYear = copyrightYear;
61     }
62
63     public static String getProfile()
64     {
65         return profile;
66     }
67
68     public void setProfile(String profile)
69     {
f21d30 70         CpzIdcConfig.profile = profile;
43dc29 71     }
Y 72
73     public static boolean isAddressEnabled()
74     {
75         return addressEnabled;
76     }
77
78     public void setAddressEnabled(boolean addressEnabled)
79     {
f21d30 80         CpzIdcConfig.addressEnabled = addressEnabled;
43dc29 81     }
Y 82
83     public static String getCaptchaType() {
84         return captchaType;
85     }
86
87     public void setCaptchaType(String captchaType) {
f21d30 88         CpzIdcConfig.captchaType = captchaType;
43dc29 89     }
Y 90
91     /**
92      * 获取导入上传路径
93      */
94     public static String getImportPath()
95     {
96         return getProfile() + "/import";
97     }
98
99     /**
100      * 获取头像上传路径
101      */
102     public static String getAvatarPath()
103     {
104         return getProfile() + "/avatar";
105     }
106
107     /**
108      * 获取下载路径
109      */
110     public static String getDownloadPath()
111     {
112         return getProfile() + "/download/";
113     }
114
115     /**
116      * 获取上传路径
117      */
118     public static String getUploadPath()
119     {
120         return getProfile() + "/upload";
121     }
122 }