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