diff --git a/pig-common/pig-common-core/src/main/java/com/pig4cloud/pig/common/core/constant/CacheConstants.java b/pig-common/pig-common-core/src/main/java/com/pig4cloud/pig/common/core/constant/CacheConstants.java index c841b82d..b60d2d20 100644 --- a/pig-common/pig-common-core/src/main/java/com/pig4cloud/pig/common/core/constant/CacheConstants.java +++ b/pig-common/pig-common-core/src/main/java/com/pig4cloud/pig/common/core/constant/CacheConstants.java @@ -59,9 +59,4 @@ public interface CacheConstants { */ String CLIENT_DETAILS_KEY = "pig_oauth:client:details"; - /** - * 参数缓存 - */ - String PARAMS_DETAILS = "params_details"; - } diff --git a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/MenuController.java b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/MenuController.java index 1138e7e2..e37451e3 100644 --- a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/MenuController.java +++ b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/MenuController.java @@ -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(); + } + } diff --git a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysMenuService.java b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysMenuService.java index 7519d802..6b842e50 100644 --- a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysMenuService.java +++ b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysMenuService.java @@ -70,4 +70,9 @@ public interface SysMenuService extends IService { */ List> filterMenu(Set menuSet, Long parentId); + /** + * 清除菜单缓存 + */ + void clearMenuCache(); + } diff --git a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysMenuServiceImpl.java b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysMenuServiceImpl.java index 532bdbce..d34b6fb3 100644 --- a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysMenuServiceImpl.java +++ b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysMenuServiceImpl.java @@ -132,6 +132,12 @@ public class SysMenuServiceImpl extends ServiceImpl impl return TreeUtil.build(collect, parent); } + @Override + @CacheEvict(value = CacheConstants.MENU_DETAILS, allEntries = true) + public void clearMenuCache() { + + } + @NotNull private Function> getNodeFunction() { return menu -> {