diff --git a/springboot-util/src/main/java/com/tiesheng/util/config/GlobalConfig.java b/springboot-util/src/main/java/com/tiesheng/util/config/GlobalConfig.java index 8bb24b5..53ff1f8 100644 --- a/springboot-util/src/main/java/com/tiesheng/util/config/GlobalConfig.java +++ b/springboot-util/src/main/java/com/tiesheng/util/config/GlobalConfig.java @@ -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 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 getExt() { + return ext; + } + + public void setExt(HashMap ext) { + this.ext = ext; + } }