中国算力平台算力登记系统2.0
YZFG
2024-09-30 43dc2996fd2033991539ed35a0429238829a5417
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
12 @ConfigurationProperties(prefix = "ruoyi")
13 public class RuoYiConfig
14 {
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     {
70         RuoYiConfig.profile = profile;
71     }
72
73     public static boolean isAddressEnabled()
74     {
75         return addressEnabled;
76     }
77
78     public void setAddressEnabled(boolean addressEnabled)
79     {
80         RuoYiConfig.addressEnabled = addressEnabled;
81     }
82
83     public static String getCaptchaType() {
84         return captchaType;
85     }
86
87     public void setCaptchaType(String captchaType) {
88         RuoYiConfig.captchaType = captchaType;
89     }
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 }