| | |
| | | package com.vincent.rsf.server.system.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.vincent.rsf.framework.common.Cools; |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.framework.common.SnowflakeIdWorker; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.common.annotation.OperationLog; |
| | | import com.vincent.rsf.server.common.domain.BaseParam; |
| | | import com.vincent.rsf.server.common.domain.KeyValVo; |
| | |
| | | config.setUpdateTime(new Date()); |
| | | if (!configService.save(config)) { |
| | | return R.error("Save Fail"); |
| | | } else { |
| | | ConfigServiceImpl.CONFIG_CACHE.put(config.getFlag(), config); |
| | | } |
| | | ConfigServiceImpl.CONFIG_CACHE.put(config.getFlag(), config); |
| | | configService.evictSysConfigRedis(config.getFlag()); |
| | | return R.ok("Save Success").add(config); |
| | | } |
| | | |
| | |
| | | config.setUpdateTime(new Date()); |
| | | if (!configService.updateById(config)) { |
| | | return R.error("Update Fail"); |
| | | } else { |
| | | ConfigServiceImpl.CONFIG_CACHE.put(config.getFlag(), config); |
| | | } |
| | | ConfigServiceImpl.CONFIG_CACHE.put(config.getFlag(), config); |
| | | configService.evictSysConfigRedis(config.getFlag()); |
| | | return R.ok("Update Success").add(config); |
| | | } |
| | | |
| | |
| | | } |
| | | if (!configService.removeByIds(Arrays.asList(ids))) { |
| | | return R.error("Delete Fail"); |
| | | } else { |
| | | for (String flag : flagList) { |
| | | ConfigServiceImpl.CONFIG_CACHE.remove(flag); |
| | | } |
| | | } |
| | | for (String flag : flagList) { |
| | | ConfigServiceImpl.CONFIG_CACHE.remove(flag); |
| | | configService.evictSysConfigRedis(flag); |
| | | } |
| | | return R.ok("Delete Success").add(ids); |
| | | } |