| | |
| | | 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; |
| | |
| | | if ("0".equals(config.getStatus())) { |
| | | RedisUtils.setCacheObject(OssConstant.DEFAULT_CONFIG_KEY, configKey); |
| | | } |
| | | CacheUtils.put(CacheNames.SYS_OSS_CONFIG, config.getConfigKey(), config); |
| | | CacheUtils.put(CacheNames.SYS_OSS_CONFIG, config.getConfigKey(), JsonUtils.toJsonString(config)); |
| | | } |
| | | } |
| | | } finally { |
| | |
| | | lqw.eq(StringUtils.isNotBlank(bo.getConfigKey()), SysOssConfig::getConfigKey, bo.getConfigKey()); |
| | | lqw.like(StringUtils.isNotBlank(bo.getBucketName()), SysOssConfig::getBucketName, bo.getBucketName()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getStatus()), SysOssConfig::getStatus, bo.getStatus()); |
| | | lqw.orderByAsc(SysOssConfig::getOssConfigId); |
| | | return lqw; |
| | | } |
| | | |
| | |
| | | validEntityBeforeSave(config); |
| | | boolean flag = baseMapper.insert(config) > 0; |
| | | if (flag) { |
| | | CacheUtils.put(CacheNames.SYS_OSS_CONFIG, config.getConfigKey(), config); |
| | | CacheUtils.put(CacheNames.SYS_OSS_CONFIG, config.getConfigKey(), JsonUtils.toJsonString(config)); |
| | | } |
| | | return flag; |
| | | } |
| | |
| | | luw.eq(SysOssConfig::getOssConfigId, config.getOssConfigId()); |
| | | boolean flag = baseMapper.update(config, luw) > 0; |
| | | if (flag) { |
| | | CacheUtils.put(CacheNames.SYS_OSS_CONFIG, config.getConfigKey(), config); |
| | | CacheUtils.put(CacheNames.SYS_OSS_CONFIG, config.getConfigKey(), JsonUtils.toJsonString(config)); |
| | | } |
| | | return flag; |
| | | } |