mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-11-04 14:19:44 +08:00
update 优化 oss初始化日志
This commit is contained in:
parent
ff297aa68f
commit
ae882b8e6b
@ -51,14 +51,29 @@ public class SysOssConfigServiceImpl implements ISysOssConfigService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void init() {
|
public void init() {
|
||||||
List<SysOssConfig> list = ossConfigMapper.selectList();
|
try {
|
||||||
// 加载OSS初始化配置
|
List<SysOssConfig> list = ossConfigMapper.selectList();
|
||||||
for (SysOssConfig config : list) {
|
if (CollUtil.isEmpty(list)) {
|
||||||
String configKey = config.getConfigKey();
|
log.warn("OSS配置初始化未查询到配置数据");
|
||||||
if (SystemConstants.YES.equals(config.getStatus())) {
|
return;
|
||||||
RedisUtils.setCacheObject(OssConstant.DEFAULT_CONFIG_KEY, configKey);
|
|
||||||
}
|
}
|
||||||
CacheUtils.put(CacheNames.SYS_OSS_CONFIG, config.getConfigKey(), JsonUtils.toJsonString(config));
|
|
||||||
|
boolean hasDefaultConfig = false;
|
||||||
|
// 加载OSS初始化配置
|
||||||
|
for (SysOssConfig config : list) {
|
||||||
|
String configKey = config.getConfigKey();
|
||||||
|
if (SystemConstants.YES.equals(config.getStatus())) {
|
||||||
|
RedisUtils.setCacheObject(OssConstant.DEFAULT_CONFIG_KEY, configKey);
|
||||||
|
hasDefaultConfig = true;
|
||||||
|
}
|
||||||
|
CacheUtils.put(CacheNames.SYS_OSS_CONFIG, configKey, JsonUtils.toJsonString(config));
|
||||||
|
}
|
||||||
|
if (!hasDefaultConfig) {
|
||||||
|
log.warn("OSS配置初始化未找到启用的默认配置");
|
||||||
|
}
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
log.error("OSS配置初始化失败", e);
|
||||||
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user