| | |
| | | package com.ruoyi.system.controller.sys; |
| | | |
| | | import java.util.List; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.core.constant.UserConstants; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.system.domain.pojo.sys.SysMenu; |
| | | import com.ruoyi.system.service.sys.ISysMenuService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 菜单信息 |
| | |
| | | return success(menuService.buildMenuTreeSelect(menus)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 加载对应角色菜单列表树 |
| | | */ |
| | |
| | | return ajax; |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "加载对应部门菜单列表树") |
| | | @GetMapping(value = "/deptMenuTreeselect/{deptId}") |
| | | public AjaxResult deptMenuTreeselect(@PathVariable("deptId") Long deptId) |
| | | { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | List<SysMenu> menus = menuService.selectMenuList(userId); |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | ajax.put("checkedKeys", menuService.selectMenuListByDeptId(deptId)); |
| | | ajax.put("menus", menuService.buildMenuTreeSelect(menus)); |
| | | return ajax; |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "加载对应部门用户菜单列表树") |
| | | @GetMapping(value = "/deptUserMenuTreeselect/{deptUserId}") |
| | | public AjaxResult deptUserMenuTreeselect(@PathVariable("deptUserId") Long deptUserId) |
| | | { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | List<SysMenu> menus = menuService.selectDeptMenuList(deptUserId); |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | ajax.put("checkedKeys", menuService.selectMenuListByDeptUserId(deptUserId)); |
| | | ajax.put("menus", menuService.buildMenuTreeSelect(menus)); |
| | | return ajax; |
| | | } |
| | | |
| | | /** |
| | | * 新增菜单 |
| | | */ |