mirror of
http://git.pig4cloud.com/pig/pigx.git
synced 2026-11-13 22:09:00 +08:00
✨ Introducing new features. closed #3028 字典、参数管理 spring cache 支持主动刷新
This commit is contained in:
1 parent
28bae7bb83
commit
7473bdad0c
6 files changed
+53
No files matched your search
+10
@@ -178,4 +178,14 @@ public class SysDictController {
|
||||
return sysDictItemService.removeDictItem(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步缓存字典
|
||||
* @return R
|
||||
*/
|
||||
@SysLog("同步字典")
|
||||
@PutMapping("/sync")
|
||||
public R sync() {
|
||||
return sysDictService.syncDictCache();
|
||||
}
|
||||
|
||||
}
|
||||
+10
@@ -118,4 +118,14 @@ public class SysPublicParamController {
|
||||
return sysPublicParamService.removeParam(publicId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步参数
|
||||
* @return R
|
||||
*/
|
||||
@SysLog("同步参数")
|
||||
@PutMapping("/sync")
|
||||
public R sync() {
|
||||
return sysPublicParamService.syncDictCache();
|
||||
}
|
||||
|
||||
}
|
||||
+6
@@ -42,4 +42,10 @@ public interface SysDictService extends IService<SysDict> {
|
||||
*/
|
||||
R updateDict(SysDict sysDict);
|
||||
|
||||
/**
|
||||
* 同步缓存 (清空缓存)
|
||||
* @return R
|
||||
*/
|
||||
R syncDictCache();
|
||||
|
||||
}
|
||||
+6
@@ -50,4 +50,10 @@ public interface SysPublicParamService extends IService<SysPublicParam> {
|
||||
*/
|
||||
R removeParam(Long publicId);
|
||||
|
||||
/**
|
||||
* 同步缓存
|
||||
* @return R
|
||||
*/
|
||||
R syncDictCache();
|
||||
|
||||
}
|
||||
+11
@@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
+10
@@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user