| | |
| | | import com.doumee.core.constants.OperaType; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | 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; |
| | |
| | | @Autowired |
| | | private SystemMenuBiz systemMenuBiz; |
| | | |
| | | @ApiOperation("菜单排序") |
| | | @PostMapping("/updateSort") |
| | | @RequiresPermissions("system:menu:sort") |
| | | public ApiResponse updateSort (@Validated @RequestBody UpdateSystemMenuSortDTO dto) { |
| | | systemMenuBiz.updateSort(dto); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("查询菜单树") |
| | | @GetMapping("/treeNodes") |
| | | public ApiResponse<List<SystemMenuNodeVO>> getTreeMenu () { |
| | | LoginUserInfo loginUserInfo = this.getLoginUser(); |
| | | return ApiResponse.success(systemMenuBiz.findTree(loginUserInfo.getId(),loginUserInfo.getType())); |
| | | return ApiResponse.success(systemMenuBiz.findTree(loginUserInfo.getId(), Constants.ONE)); |
| | | } |
| | | |
| | | // @ApiOperation("查询列表树") |
| | | // @PostMapping("/treeList") |
| | | // @RequiresPermissions("system:menu:query") |
| | | // public ApiResponse<List<SystemMenuListVO>> findTree () { |
| | | // LoginUserInfo loginUserInfo = this.getLoginUser(); |
| | | // return ApiResponse.success(systemMenuBiz.findTreeByType(loginUserInfo.getType())); |
| | | // } |
| | | |
| | | |
| | | @ApiOperation("查询列表树") |
| | | @PostMapping("/treeList/{type}") |
| | | @RequiresPermissions("system:menu:query") |
| | | public ApiResponse<List<SystemMenuListVO>> treeList (@PathVariable Integer type) { |
| | | return ApiResponse.success(systemMenuBiz.findTreeByType(type)); |
| | | return ApiResponse.success(systemMenuBiz.findTreeByType(Constants.ONE)); |
| | | } |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("新建") |
| | | @PostMapping("/create") |
| | | @RequiresPermissions("system:menu:create") |
| | | public ApiResponse create(@Validated(OperaType.Create.class) @RequestBody SystemMenu systemMenu) { |
| | | return ApiResponse.success(systemMenuBiz.create(systemMenu)); |
| | | } |
| | | |
| | | @ApiOperation("删除") |
| | | @GetMapping("/delete/{id}") |
| | | @RequiresPermissions("system:menu:delete") |
| | | public ApiResponse deleteById(@PathVariable Integer id) { |
| | | systemMenuBiz.deleteById(id); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("批量删除") |
| | | @GetMapping("/delete/batch") |
| | | @RequiresPermissions("system:menu:delete") |
| | | public ApiResponse deleteByIdInBatch(@RequestParam String ids) { |
| | | String [] idArray = ids.split(","); |
| | | List<Integer> idList = new ArrayList<>(); |
| | | for (String id : idArray) { |
| | | idList.add(Integer.valueOf(id)); |
| | | } |
| | | systemMenuBiz.deleteByIdInBatch(idList); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("修改") |
| | | @PostMapping("/updateById") |
| | | @RequiresPermissions("system:menu:update") |
| | | public ApiResponse updateById(@Validated(OperaType.Update.class) @RequestBody SystemMenu systemMenu) { |
| | | systemMenuBiz.updateById(systemMenu); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("修改菜单状态") |
| | | @PostMapping("/updateStatus") |
| | | @RequiresPermissions("system:menu:update") |
| | | public ApiResponse updateStatus(@Validated(OperaType.UpdateStatus.class) @RequestBody SystemMenu systemMenu) { |
| | | systemMenuBiz.updateById(systemMenu); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | } |