diff --git a/pig-admin-service/src/main/java/com/github/pig/admin/controller/MenuController.java b/pig-admin-service/src/main/java/com/github/pig/admin/controller/MenuController.java index f8e2cc6d..caecaa3c 100644 --- a/pig-admin-service/src/main/java/com/github/pig/admin/controller/MenuController.java +++ b/pig-admin-service/src/main/java/com/github/pig/admin/controller/MenuController.java @@ -24,7 +24,7 @@ import java.util.Set; @RequestMapping("/menu") public class MenuController extends BaseController { @Autowired - private SysMenuService menuService; + private SysMenuService sysMenuService; /** * 通过用户名查询用户菜单 @@ -34,7 +34,7 @@ public class MenuController extends BaseController { */ @GetMapping("/findMenuByRole/{role}") public Set findMenuByRole(@PathVariable String role) { - return menuService.findMenuByRole(role, 0); + return sysMenuService.findMenuByRole(role, 0); } /** @@ -46,7 +46,7 @@ public class MenuController extends BaseController { public List getTree() { SysMenu condition = new SysMenu(); condition.setDelFlag(CommonConstant.STATUS_NORMAL); - return getMenuTree(menuService.selectList(new EntityWrapper<>(condition)), -1); + return getMenuTree(sysMenuService.selectList(new EntityWrapper<>(condition)), -1); } /** @@ -56,7 +56,7 @@ public class MenuController extends BaseController { */ @GetMapping("/userTree/{type}") public List userTree(@PathVariable Integer type) { - Set menus = menuService.findMenuByRole(getRole().get(0), type); + Set menus = sysMenuService.findMenuByRole(getRole().get(0), type); List menuList = new ArrayList<>(); for (MenuVo menuVo : menus) { menuList.add(menuVo.getMenuId()); @@ -72,7 +72,7 @@ public class MenuController extends BaseController { */ @GetMapping("/{id}") public SysMenu menu(@PathVariable Integer id) { - return menuService.selectById(id); + return sysMenuService.selectById(id); } /** @@ -83,7 +83,7 @@ public class MenuController extends BaseController { */ @PostMapping public Boolean menu(@RequestBody SysMenu sysMenu) { - return menuService.insert(sysMenu); + return sysMenuService.insert(sysMenu); } /** @@ -100,21 +100,21 @@ public class MenuController extends BaseController { SysMenu condition1 = new SysMenu(); condition1.setMenuId(id); condition1.setDelFlag(CommonConstant.STATUS_DEL); - menuService.updateById(condition1); + sysMenuService.updateById(condition1); // 删除父节点为当前节点的节点 SysMenu conditon2 = new SysMenu(); conditon2.setParentId(id); SysMenu sysMenu = new SysMenu(); sysMenu.setDelFlag(CommonConstant.STATUS_DEL); - menuService.update(sysMenu, new EntityWrapper<>(conditon2)); + sysMenuService.update(sysMenu, new EntityWrapper<>(conditon2)); return Boolean.TRUE; } @PutMapping @CacheEvict(value = "menu_details",allEntries = true) public Boolean menuUpdate(@RequestBody SysMenu sysMenu) { - return menuService.updateById(sysMenu); + return sysMenuService.updateById(sysMenu); } private List getMenuTree(List menus, int root) { diff --git a/pig-admin-service/src/main/java/com/github/pig/admin/controller/UserController.java b/pig-admin-service/src/main/java/com/github/pig/admin/controller/UserController.java index a56fd5b6..ecd88f20 100644 --- a/pig-admin-service/src/main/java/com/github/pig/admin/controller/UserController.java +++ b/pig-admin-service/src/main/java/com/github/pig/admin/controller/UserController.java @@ -30,7 +30,7 @@ public class UserController extends BaseController { @Autowired private SysUserRoleService sysUserRoleService; @Autowired - private SysMenuService menuService; + private SysMenuService sysMenuService; /** * 获取当前用户的用户名 @@ -49,7 +49,7 @@ public class UserController extends BaseController { String[] roles = getRole().toArray(new String[getRole().size()]); userInfo.setRoles(roles); //设置权限列表(menu.permission) - String[] permissions = menuService.findPermission(roles); + String[] permissions = sysMenuService.findPermission(roles); userInfo.setPermissions(permissions); return userInfo; }