update 优化 业务缓存代码

master
疯狂的狮子li 3 years ago
parent d351c59b38
commit 9f2fe90e50

@ -82,7 +82,8 @@ public class SysConfigController extends BaseController {
if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) { if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) {
return R.fail("新增参数'" + config.getConfigName() + "'失败,参数键名已存在"); return R.fail("新增参数'" + config.getConfigName() + "'失败,参数键名已存在");
} }
return R.ok(configService.insertConfig(config)); configService.insertConfig(config);
return R.ok();
} }
/** /**
@ -95,7 +96,8 @@ public class SysConfigController extends BaseController {
if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) { if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) {
return R.fail("修改参数'" + config.getConfigName() + "'失败,参数键名已存在"); return R.fail("修改参数'" + config.getConfigName() + "'失败,参数键名已存在");
} }
return R.ok(configService.updateConfig(config)); configService.updateConfig(config);
return R.ok();
} }
/** /**
@ -105,7 +107,8 @@ public class SysConfigController extends BaseController {
@Log(title = "参数管理", businessType = BusinessType.UPDATE) @Log(title = "参数管理", businessType = BusinessType.UPDATE)
@PutMapping("/updateByKey") @PutMapping("/updateByKey")
public R<Void> updateByKey(@RequestBody SysConfig config) { public R<Void> updateByKey(@RequestBody SysConfig config) {
return R.ok(configService.updateConfig(config)); configService.updateConfig(config);
return R.ok();
} }
/** /**

@ -112,6 +112,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService, DictService
* @param dictType * @param dictType
* @return * @return
*/ */
@Cacheable(cacheNames = CacheNames.SYS_DICT, key = "#dictType")
@Override @Override
public SysDictType selectDictTypeByType(String dictType) { public SysDictType selectDictTypeByType(String dictType) {
return baseMapper.selectById(new LambdaQueryWrapper<SysDictType>().eq(SysDictType::getDictType, dictType)); return baseMapper.selectById(new LambdaQueryWrapper<SysDictType>().eq(SysDictType::getDictType, dictType));

Loading…
Cancel
Save