|  |  |  | 
|---|
|  |  |  | import com.doumee.core.annotation.pr.PreventRepeat; | 
|---|
|  |  |  | import com.doumee.core.constants.OperaType; | 
|---|
|  |  |  | import com.doumee.core.model.ApiResponse; | 
|---|
|  |  |  | import com.doumee.core.utils.Constants; | 
|---|
|  |  |  | import com.doumee.dao.system.dto.UpdateSystemMenuSortDTO; | 
|---|
|  |  |  | import com.doumee.dao.system.model.SystemMenu; | 
|---|
|  |  |  | import com.doumee.dao.system.vo.SystemMenuListVO; | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiOperation("菜单排序") | 
|---|
|  |  |  | @PostMapping("/updateSort") | 
|---|
|  |  |  | @RequiresPermissions("system:menu:sort") | 
|---|
|  |  |  | public ApiResponse updateSort (@Validated @RequestBody UpdateSystemMenuSortDTO dto) { | 
|---|
|  |  |  | public ApiResponse updateSort (@Validated @RequestBody UpdateSystemMenuSortDTO dto, @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | dto.setUpdateUser(this.getLoginUser(token).getId()); | 
|---|
|  |  |  | systemMenuBiz.updateSort(dto); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiOperation("查询菜单树") | 
|---|
|  |  |  | @GetMapping("/treeNodes") | 
|---|
|  |  |  | public ApiResponse<List<SystemMenuNodeVO>> getTreeMenu () { | 
|---|
|  |  |  | return ApiResponse.success(systemMenuBiz.findTree(this.getLoginUser().getId())); | 
|---|
|  |  |  | return ApiResponse.success(systemMenuBiz.findTree(this.getLoginUser(null).getId())); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("查询列表树") | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiOperation("新建") | 
|---|
|  |  |  | @PostMapping("/create") | 
|---|
|  |  |  | @RequiresPermissions("system:menu:create") | 
|---|
|  |  |  | public ApiResponse create(@Validated(OperaType.Create.class) @RequestBody SystemMenu systemMenu) { | 
|---|
|  |  |  | public ApiResponse create(@Validated(OperaType.Create.class) @RequestBody SystemMenu systemMenu, @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | systemMenu.setCreateUser(this.getLoginUser(token).getId()); | 
|---|
|  |  |  | return ApiResponse.success(systemMenuBiz.create(systemMenu)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiOperation("修改") | 
|---|
|  |  |  | @PostMapping("/updateById") | 
|---|
|  |  |  | @RequiresPermissions("system:menu:update") | 
|---|
|  |  |  | public ApiResponse updateById(@Validated(OperaType.Update.class) @RequestBody SystemMenu systemMenu) { | 
|---|
|  |  |  | public ApiResponse updateById(@Validated(OperaType.Update.class) @RequestBody SystemMenu systemMenu, @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | systemMenu.setUpdateUser(this.getLoginUser(token).getId()); | 
|---|
|  |  |  | systemMenuBiz.updateById(systemMenu); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiOperation("修改菜单状态") | 
|---|
|  |  |  | @PostMapping("/updateStatus") | 
|---|
|  |  |  | @RequiresPermissions("system:menu:update") | 
|---|
|  |  |  | public ApiResponse updateStatus(@Validated(OperaType.UpdateStatus.class) @RequestBody SystemMenu systemMenu) { | 
|---|
|  |  |  | public ApiResponse updateStatus(@Validated(OperaType.UpdateStatus.class) @RequestBody SystemMenu systemMenu, @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | systemMenu.setUpdateUser(this.getLoginUser(token).getId()); | 
|---|
|  |  |  | systemMenuBiz.updateById(systemMenu); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|