mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-11-02 13:31:49 +08:00
update 优化 oss初始化日志
This commit is contained in:
parent
ff297aa68f
commit
ae882b8e6b
@ -51,14 +51,29 @@ public class SysOssConfigServiceImpl implements ISysOssConfigService {
|
||||
*/
|
||||
@Override
|
||||
public void init() {
|
||||
List<SysOssConfig> list = ossConfigMapper.selectList();
|
||||
// 加载OSS初始化配置
|
||||
for (SysOssConfig config : list) {
|
||||
String configKey = config.getConfigKey();
|
||||
if (SystemConstants.YES.equals(config.getStatus())) {
|
||||
RedisUtils.setCacheObject(OssConstant.DEFAULT_CONFIG_KEY, configKey);
|
||||
try {
|
||||
List<SysOssConfig> list = ossConfigMapper.selectList();
|
||||
if (CollUtil.isEmpty(list)) {
|
||||
log.warn("OSS配置初始化未查询到配置数据");
|
||||
return;
|
||||
}
|
||||
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