✨ Introducing new features. closed #3028 字典、参数管理 spring cache 支持主动刷新

This commit is contained in:
YLC8E committed 2021-10-06 18:53:20 +08:00
1 parent 28bae7bb83
commit 7473bdad0c
6 files changed
+53

No files matched your search

@@ -178,4 +178,14 @@ public class SysDictController {
return sysDictItemService.removeDictItem(id);
}
/**
* 同步缓存字典
* @return R
*/
@SysLog("同步字典")
@PutMapping("/sync")
public R sync() {
return sysDictService.syncDictCache();
}
}
@@ -118,4 +118,14 @@ public class SysPublicParamController {
return sysPublicParamService.removeParam(publicId);
}
/**
* 同步参数
* @return R
*/
@SysLog("同步参数")
@PutMapping("/sync")
public R sync() {
return sysPublicParamService.syncDictCache();
}
}
@@ -42,4 +42,10 @@ public interface SysDictService extends IService<SysDict> {
*/
R updateDict(SysDict sysDict);
/**
* 同步缓存 (清空缓存)
* @return R
*/
R syncDictCache();
}
@@ -50,4 +50,10 @@ public interface SysPublicParamService extends IService<SysPublicParam> {
*/
R removeParam(Long publicId);
/**
* 同步缓存
* @return R
*/
R syncDictCache();
}
@@ -69,6 +69,7 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
* @return
*/
@Override
@CacheEvict(value = CacheConstants.DICT_DETAILS, allEntries = true)
public R updateDict(SysDict dict) {
SysDict sysDict = this.getById(dict.getId());
// 系统内置
@@ -78,4 +79,14 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
return R.ok(this.updateById(dict));
}
/**
* 同步缓存 (清空缓存)
* @return R
*/
@Override
@CacheEvict(value = CacheConstants.DICT_DETAILS, allEntries = true)
public R syncDictCache() {
return R.ok();
}
}
@@ -85,4 +85,14 @@ public class SysPublicParamServiceImpl extends ServiceImpl<SysPublicParamMapper,
return R.ok(this.removeById(publicId));
}
/**
* 同步缓存
* @return R
*/
@Override
@CacheEvict(value = CacheConstants.PARAMS_DETAILS, allEntries = true)
public R syncDictCache() {
return R.ok();
}
}