update 优化 redis序列化配置 更改为通用格式(升级需清除redis所有数据)

This commit is contained in:
疯狂的狮子Li
2023-08-10 12:57:42 +08:00
parent 15a7a83966
commit 84429206dc
2 changed files with 18 additions and 7 deletions

View File

@ -13,7 +13,6 @@ import org.dromara.common.core.exception.ServiceException;
import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.core.utils.StreamUtils;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.json.utils.JsonUtils;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.oss.constant.OssConstant;
@ -66,7 +65,7 @@ public class SysOssConfigServiceImpl implements ISysOssConfigService {
if ("0".equals(config.getStatus())) {
RedisUtils.setCacheObject(OssConstant.DEFAULT_CONFIG_KEY, configKey);
}
CacheUtils.put(CacheNames.SYS_OSS_CONFIG, config.getConfigKey(), JsonUtils.toJsonString(config));
CacheUtils.put(CacheNames.SYS_OSS_CONFIG, config.getConfigKey(), config);
}
}
} finally {
@ -101,7 +100,7 @@ public class SysOssConfigServiceImpl implements ISysOssConfigService {
validEntityBeforeSave(config);
boolean flag = baseMapper.insert(config) > 0;
if (flag) {
CacheUtils.put(CacheNames.SYS_OSS_CONFIG, config.getConfigKey(), JsonUtils.toJsonString(config));
CacheUtils.put(CacheNames.SYS_OSS_CONFIG, config.getConfigKey(), config);
}
return flag;
}
@ -118,7 +117,7 @@ public class SysOssConfigServiceImpl implements ISysOssConfigService {
luw.eq(SysOssConfig::getOssConfigId, config.getOssConfigId());
boolean flag = baseMapper.update(config, luw) > 0;
if (flag) {
CacheUtils.put(CacheNames.SYS_OSS_CONFIG, config.getConfigKey(), JsonUtils.toJsonString(config));
CacheUtils.put(CacheNames.SYS_OSS_CONFIG, config.getConfigKey(), config);
}
return flag;
}