| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.google.common.collect.Lists; |
| | | import com.ruoyi.common.constant.UserConstants; |
| | | import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; |
| | | import com.ruoyi.common.core.page.PagePlus; |
| | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 云存储配置Service业务层处理 |
| | | * 对象存储配置Service业务层处理 |
| | | * |
| | | * @author Lion Li |
| | | * @author 孤舟烟雨 |
| | |
| | | public Boolean updateByBo(SysOssConfigBo bo) { |
| | | SysOssConfig config = BeanUtil.toBean(bo, SysOssConfig.class); |
| | | validEntityBeforeSave(config); |
| | | return setConfigCache(updateById(config), config); |
| | | LambdaUpdateWrapper<SysOssConfig> luw = new LambdaUpdateWrapper<>(); |
| | | luw.set(StringUtils.isBlank(config.getPrefix()), SysOssConfig::getPrefix, ""); |
| | | luw.set(StringUtils.isBlank(config.getRegion()), SysOssConfig::getRegion, ""); |
| | | luw.set(StringUtils.isBlank(config.getExt1()), SysOssConfig::getExt1, ""); |
| | | luw.eq(SysOssConfig::getOssConfigId, config.getOssConfigId()); |
| | | return setConfigCache(update(config, luw), config); |
| | | } |
| | | |
| | | /** |
| | |
| | | throw new ServiceException("系统内置, 不可删除!"); |
| | | } |
| | | } |
| | | List<SysOssConfig> list = Lists.newArrayList(); |
| | | for (Long configId : ids) { |
| | | SysOssConfig config = getById(configId); |
| | | list.add(config); |
| | | } |
| | | boolean flag = removeByIds(ids); |
| | | if (flag) { |
| | | for (Long configId : ids) { |
| | | SysOssConfig config = getById(configId); |
| | | RedisUtils.deleteObject(getCacheKey(config.getConfigKey())); |
| | | } |
| | | } |
| | | return flag; |
| | | if (flag) { |
| | | list.stream().forEach(sysOssConfig -> { |
| | | RedisUtils.deleteObject(getCacheKey(sysOssConfig.getConfigKey())); |
| | | }); |
| | | } |
| | | return flag; |
| | | } |
| | | |
| | | /** |