|
|
@ -1,8 +1,6 @@ |
|
|
|
package com.shuili.common.config; |
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
import org.springframework.boot.context.properties.ConfigurationProperties; |
|
|
|
import org.springframework.context.annotation.Lazy; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
/** |
|
|
@ -11,26 +9,35 @@ import org.springframework.stereotype.Component; |
|
|
|
* @author shuili |
|
|
|
*/ |
|
|
|
@Component |
|
|
|
//@ConfigurationProperties(prefix = "shuili")
|
|
|
|
public class ShuiliConfig |
|
|
|
{ |
|
|
|
/** 项目名称 */ |
|
|
|
@ConfigurationProperties(prefix = "shuili") |
|
|
|
public class ShuiliConfig { |
|
|
|
/** |
|
|
|
* 项目名称 |
|
|
|
*/ |
|
|
|
private static String name; |
|
|
|
|
|
|
|
private static String nameKey; |
|
|
|
private static String nameKey; |
|
|
|
|
|
|
|
/** 版本 */ |
|
|
|
/** |
|
|
|
* 版本 |
|
|
|
*/ |
|
|
|
private String version; |
|
|
|
|
|
|
|
/** 版权年份 */ |
|
|
|
/** |
|
|
|
* 版权年份 |
|
|
|
*/ |
|
|
|
private String copyrightYear; |
|
|
|
|
|
|
|
/** 实例演示开关 */ |
|
|
|
/** |
|
|
|
* 实例演示开关 |
|
|
|
*/ |
|
|
|
private boolean demoEnabled; |
|
|
|
|
|
|
|
/** 上传路径 */ |
|
|
|
/** |
|
|
|
* 上传路径 |
|
|
|
*/ |
|
|
|
|
|
|
|
private static String profile="D:/tianhui"; |
|
|
|
private static String profile = "D:/tianhui"; |
|
|
|
|
|
|
|
private static String licensePath; |
|
|
|
|
|
|
@ -38,11 +45,13 @@ public class ShuiliConfig |
|
|
|
return licensePath; |
|
|
|
} |
|
|
|
|
|
|
|
public void setLicensePath(String licensePath) { |
|
|
|
public void setLicensePath(String licensePath) { |
|
|
|
ShuiliConfig.licensePath = licensePath; |
|
|
|
} |
|
|
|
|
|
|
|
/** 获取地址开关 */ |
|
|
|
/** |
|
|
|
* 获取地址开关 |
|
|
|
*/ |
|
|
|
private static boolean addressEnabled; |
|
|
|
|
|
|
|
private static boolean init; |
|
|
@ -56,7 +65,7 @@ public class ShuiliConfig |
|
|
|
return detectLang; |
|
|
|
} |
|
|
|
|
|
|
|
public void setDetectLang(String detectLang) { |
|
|
|
public void setDetectLang(String detectLang) { |
|
|
|
ShuiliConfig.detectLang = detectLang; |
|
|
|
} |
|
|
|
|
|
|
@ -68,48 +77,39 @@ public class ShuiliConfig |
|
|
|
ShuiliConfig.nameKey = nameKey; |
|
|
|
} |
|
|
|
|
|
|
|
public static String getName() |
|
|
|
{ |
|
|
|
public static String getName() { |
|
|
|
return name; |
|
|
|
} |
|
|
|
|
|
|
|
public void setName(String name) |
|
|
|
{ |
|
|
|
ShuiliConfig.name = name; |
|
|
|
public void setName(String name) { |
|
|
|
ShuiliConfig.name = name; |
|
|
|
} |
|
|
|
|
|
|
|
public String getVersion() |
|
|
|
{ |
|
|
|
public String getVersion() { |
|
|
|
return version; |
|
|
|
} |
|
|
|
|
|
|
|
public void setVersion(String version) |
|
|
|
{ |
|
|
|
public void setVersion(String version) { |
|
|
|
this.version = version; |
|
|
|
} |
|
|
|
|
|
|
|
public String getCopyrightYear() |
|
|
|
{ |
|
|
|
public String getCopyrightYear() { |
|
|
|
return copyrightYear; |
|
|
|
} |
|
|
|
|
|
|
|
public void setCopyrightYear(String copyrightYear) |
|
|
|
{ |
|
|
|
public void setCopyrightYear(String copyrightYear) { |
|
|
|
this.copyrightYear = copyrightYear; |
|
|
|
} |
|
|
|
|
|
|
|
public boolean isDemoEnabled() |
|
|
|
{ |
|
|
|
public boolean isDemoEnabled() { |
|
|
|
return demoEnabled; |
|
|
|
} |
|
|
|
|
|
|
|
public void setDemoEnabled(boolean demoEnabled) |
|
|
|
{ |
|
|
|
public void setDemoEnabled(boolean demoEnabled) { |
|
|
|
this.demoEnabled = demoEnabled; |
|
|
|
} |
|
|
|
|
|
|
|
public static String getProfile() |
|
|
|
{ |
|
|
|
public static String getProfile() { |
|
|
|
return profile; |
|
|
|
} |
|
|
|
|
|
|
@ -117,8 +117,7 @@ public class ShuiliConfig |
|
|
|
return uploadType; |
|
|
|
} |
|
|
|
|
|
|
|
public void setProfile(String profile) |
|
|
|
{ |
|
|
|
public void setProfile(String profile) { |
|
|
|
ShuiliConfig.profile = profile; |
|
|
|
} |
|
|
|
|
|
|
@ -126,45 +125,40 @@ public class ShuiliConfig |
|
|
|
ShuiliConfig.uploadType = uploadType; |
|
|
|
} |
|
|
|
|
|
|
|
public static boolean isAddressEnabled() |
|
|
|
{ |
|
|
|
public static boolean isAddressEnabled() { |
|
|
|
return addressEnabled; |
|
|
|
} |
|
|
|
|
|
|
|
public void setAddressEnabled(boolean addressEnabled) |
|
|
|
{ |
|
|
|
public void setAddressEnabled(boolean addressEnabled) { |
|
|
|
ShuiliConfig.addressEnabled = addressEnabled; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取头像上传路径 |
|
|
|
*/ |
|
|
|
public static String getAvatarPath() |
|
|
|
{ |
|
|
|
public static String getAvatarPath() { |
|
|
|
return getProfile() + "/avatar"; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取下载路径 |
|
|
|
*/ |
|
|
|
public static String getDownloadPath() |
|
|
|
{ |
|
|
|
public static String getDownloadPath() { |
|
|
|
return getProfile(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取上传路径 |
|
|
|
*/ |
|
|
|
public static String getUploadPath() |
|
|
|
{ |
|
|
|
public static String getUploadPath() { |
|
|
|
return getProfile() + "/upload"; |
|
|
|
} |
|
|
|
|
|
|
|
public static boolean isInit() { |
|
|
|
return init; |
|
|
|
} |
|
|
|
public static boolean isInit() { |
|
|
|
return init; |
|
|
|
} |
|
|
|
|
|
|
|
public void setInit(boolean init) { |
|
|
|
ShuiliConfig.init = init; |
|
|
|
} |
|
|
|
public void setInit(boolean init) { |
|
|
|
ShuiliConfig.init = init; |
|
|
|
} |
|
|
|
} |
|
|
|