首页>代码>SpringBoot开发非常美观的java博客系统(包含后台管理功能)>/mblog/mblog-base/src/main/java/mblog/base/context/Global.java
package mblog.base.context; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import mblog.base.lang.Consts; import mblog.base.utils.PropertiesLoader; /** * mblog 全局配置类 */ public class Global { /** * 保存全局属性值 */ private static ConcurrentMap<String, String> map = new ConcurrentHashMap<>(); /** * 属性文件加载对象 */ private static PropertiesLoader propertiesLoader = new PropertiesLoader(Consts.MTONS_CONFIG); private static Boolean imageDomain = null; private static String imageHost = null; /** * 获取配置 */ public static String getConfig(String key) { String value = map.get(key); if (value == null){ value = propertiesLoader.getProperty(key); map.put(key, value); } return value; } public static boolean getImageDomain() { if (imageDomain == null) { imageDomain = propertiesLoader.getBoolean("resource.domain", false); } return imageDomain; } public static String getImageHost() { if (imageHost == null) { imageHost = propertiesLoader.getProperty("resource.host"); } return imageHost; } }

vincemokea LV6
前天
lanhaigcb LV3
6月5日
032932 LV1
2月22日
srmess LV4
2024年12月30日
Duangi LV1
2024年12月23日
zolscy LV24
2024年12月18日
xianyu091012 LV5
2024年11月19日
12347658 LV1
2024年11月13日
xunxia LV7
2024年10月10日
微信网友_7005760998215680 LV6
2024年10月2日

AniyaKKbi
45分钟前
暂无贡献等级
6418368 LV10
8月5日
1140717565 LV2
7月18日
limufu LV1
6月17日
2578193624 LV2
6月8日
lanhaigcb LV3
6月5日
西凉河的葛三叔 LV3
5月17日
15578157792 LV7
4月26日
vincemokea LV6
4月24日
暂无贡献等级