mirror of https://gitee.com/maxjhandsome/pig
fixed: @CacheEvict(value = "menu_details",allEntries = true)
This commit is contained in:
parent
fb5489d617
commit
8c0b835bb2
|
@ -9,6 +9,7 @@ import com.github.pig.common.constant.CommonConstant;
|
|||
import com.github.pig.common.vo.MenuVo;
|
||||
import com.github.pig.common.web.BaseController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -93,6 +94,7 @@ public class MenuController extends BaseController {
|
|||
* TODO 级联删除下级节点
|
||||
*/
|
||||
@DeleteMapping("/{id}")
|
||||
@CacheEvict(value = "menu_details",allEntries = true)
|
||||
public Boolean menuDel(@PathVariable Integer id) {
|
||||
// 删除当前节点
|
||||
SysMenu condition1 = new SysMenu();
|
||||
|
@ -110,6 +112,7 @@ public class MenuController extends BaseController {
|
|||
}
|
||||
|
||||
@PutMapping
|
||||
@CacheEvict(value = "menu_details",allEntries = true)
|
||||
public Boolean menuUpdate(@RequestBody SysMenu sysMenu) {
|
||||
return menuService.updateById(sysMenu);
|
||||
}
|
||||
|
|
|
@ -104,7 +104,7 @@ public class RoleController extends BaseController {
|
|||
* @return success、false
|
||||
*/
|
||||
@PutMapping("/roleMenuUpd")
|
||||
@CacheEvict(value = "menu_details", key = "#role +'_menu'")
|
||||
@CacheEvict(value = "menu_details",allEntries = true)
|
||||
public Boolean roleMenuUpd(Integer roleId, @RequestParam("menuIds[]") Integer[] menuIds) {
|
||||
SysRoleMenu condition = new SysRoleMenu();
|
||||
condition.setRoleId(roleId);
|
||||
|
|
|
@ -7,6 +7,7 @@ import com.github.pig.admin.service.SysMenuService;
|
|||
import com.github.pig.common.vo.MenuVo;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
@ -26,7 +27,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
|||
private SysMenuMapper sysMenuMapper;
|
||||
|
||||
@Override
|
||||
//@Cacheable(value = "menu_details", key = "#role +'_menu'")
|
||||
@Cacheable(value = "menu_details", key = "#role + #type + '_menu'")
|
||||
public Set<MenuVo> findMenuByRole(String role, Integer type) {
|
||||
return sysMenuMapper.findMenuByRoleName(role, type);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue