feat:globalConfig增加ext属性
This commit is contained in:
@@ -18,6 +18,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -32,6 +33,11 @@ public class GlobalConfig {
|
||||
private String version;
|
||||
private String uploadDir = System.getProperty("user.dir");
|
||||
|
||||
/**
|
||||
* 其他属性
|
||||
*/
|
||||
private HashMap<String, String> ext;
|
||||
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
@@ -45,6 +51,19 @@ public class GlobalConfig {
|
||||
// 逻辑方法
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* 获取扩展属性内容
|
||||
*
|
||||
* @param extkey
|
||||
* @return
|
||||
*/
|
||||
public String getExtValue(String extkey) {
|
||||
if (getExt() == null) {
|
||||
return "";
|
||||
}
|
||||
return getExt().get(extkey);
|
||||
}
|
||||
|
||||
public String getContextPath() {
|
||||
String context = SpringUtil.getProperty("server.servlet.context-path");
|
||||
if (StrUtil.isEmpty(context)) {
|
||||
@@ -148,4 +167,12 @@ public class GlobalConfig {
|
||||
public void setVersion(String version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public HashMap<String, String> getExt() {
|
||||
return ext;
|
||||
}
|
||||
|
||||
public void setExt(HashMap<String, String> ext) {
|
||||
this.ext = ext;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user