| | |
| | | import org.springframework.stereotype.Service;
|
| | | import com.ruoyi.common.core.constant.Constants;
|
| | | import com.ruoyi.common.core.constant.UserConstants;
|
| | | import com.ruoyi.common.core.exception.CustomException;
|
| | | import com.ruoyi.common.core.text.Convert;
|
| | | import com.ruoyi.common.core.utils.StringUtils;
|
| | | import com.ruoyi.common.redis.service.RedisService;
|
| | |
| | | @Override
|
| | | public int deleteConfigByIds(Long[] configIds)
|
| | | {
|
| | | for (Long configId : configIds)
|
| | | {
|
| | | SysConfig config = selectConfigById(configId);
|
| | | if (StringUtils.equals(UserConstants.YES, config.getConfigType()))
|
| | | {
|
| | | throw new CustomException(String.format("内置参数【%1$s】不能删除 ", config.getConfigKey()));
|
| | | }
|
| | | }
|
| | | int count = configMapper.deleteConfigByIds(configIds);
|
| | | if (count > 0)
|
| | | {
|
| | |
| | | /**
|
| | | * 清空缓存数据
|
| | | */
|
| | | @Override
|
| | | public void clearCache()
|
| | | {
|
| | | Collection<String> keys = redisService.keys(Constants.SYS_CONFIG_KEY + "*");
|