mirror of
https://gitee.com/log4j/pig.git
synced 2024-12-23 13:03:42 +08:00
✨ Introducing new features. 支持清除菜单缓存
This commit is contained in:
parent
393ab9add1
commit
e04698d1dc
@ -59,9 +59,4 @@ public interface CacheConstants {
|
||||
*/
|
||||
String CLIENT_DETAILS_KEY = "pig_oauth:client:details";
|
||||
|
||||
/**
|
||||
* 参数缓存
|
||||
*/
|
||||
String PARAMS_DETAILS = "params_details";
|
||||
|
||||
}
|
||||
|
@ -125,4 +125,15 @@ public class MenuController {
|
||||
return R.ok(sysMenuService.updateMenuById(sysMenu));
|
||||
}
|
||||
|
||||
/**
|
||||
* 清除菜单缓存
|
||||
*/
|
||||
@SysLog("清除菜单缓存")
|
||||
@DeleteMapping("/cache")
|
||||
@PreAuthorize("@pms.hasPermission('sys_menu_del')")
|
||||
public R clearMenuCache() {
|
||||
sysMenuService.clearMenuCache();
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -70,4 +70,9 @@ public interface SysMenuService extends IService<SysMenu> {
|
||||
*/
|
||||
List<Tree<Long>> filterMenu(Set<SysMenu> menuSet, Long parentId);
|
||||
|
||||
/**
|
||||
* 清除菜单缓存
|
||||
*/
|
||||
void clearMenuCache();
|
||||
|
||||
}
|
||||
|
@ -132,6 +132,12 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
||||
return TreeUtil.build(collect, parent);
|
||||
}
|
||||
|
||||
@Override
|
||||
@CacheEvict(value = CacheConstants.MENU_DETAILS, allEntries = true)
|
||||
public void clearMenuCache() {
|
||||
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private Function<SysMenu, TreeNode<Long>> getNodeFunction() {
|
||||
return menu -> {
|
||||
|
Loading…
Reference in New Issue
Block a user