|
16 | 16 |
|
17 | 17 | package top.charles7c.cnadmin.webapi.controller.common;
|
18 | 18 |
|
19 |
| -import java.util.*; |
| 19 | +import java.util.Arrays; |
| 20 | +import java.util.List; |
| 21 | +import java.util.Optional; |
| 22 | +import java.util.Set; |
20 | 23 | import java.util.stream.Collectors;
|
21 | 24 |
|
22 | 25 | import lombok.RequiredArgsConstructor;
|
|
25 | 28 | import io.swagger.v3.oas.annotations.tags.Tag;
|
26 | 29 |
|
27 | 30 | import org.springframework.validation.annotation.Validated;
|
28 |
| -import org.springframework.web.bind.annotation.*; |
| 31 | +import org.springframework.web.bind.annotation.GetMapping; |
| 32 | +import org.springframework.web.bind.annotation.PathVariable; |
| 33 | +import org.springframework.web.bind.annotation.RequestMapping; |
| 34 | +import org.springframework.web.bind.annotation.RestController; |
29 | 35 |
|
30 | 36 | import cn.hutool.core.lang.tree.Tree;
|
31 | 37 | import cn.hutool.core.util.ClassUtil;
|
@@ -65,21 +71,21 @@ public class CommonController {
|
65 | 71 |
|
66 | 72 | @Operation(summary = "查询部门树", description = "查询树结构的部门列表")
|
67 | 73 | @GetMapping("/tree/dept")
|
68 |
| - public R<List<Tree<Long>>> listDeptTree(@Validated DeptQuery query, @Validated SortQuery sortQuery) { |
| 74 | + public R<List<Tree<Long>>> listDeptTree(DeptQuery query, SortQuery sortQuery) { |
69 | 75 | List<Tree<Long>> treeList = deptService.tree(query, sortQuery, true);
|
70 | 76 | return R.ok(treeList);
|
71 | 77 | }
|
72 | 78 |
|
73 | 79 | @Operation(summary = "查询菜单树", description = "查询树结构的菜单列表")
|
74 | 80 | @GetMapping("/tree/menu")
|
75 |
| - public R<List<Tree<Long>>> listMenuTree(@Validated MenuQuery query, @Validated SortQuery sortQuery) { |
| 81 | + public R<List<Tree<Long>>> listMenuTree(MenuQuery query, SortQuery sortQuery) { |
76 | 82 | List<Tree<Long>> treeList = menuService.tree(query, sortQuery, true);
|
77 | 83 | return R.ok(treeList);
|
78 | 84 | }
|
79 | 85 |
|
80 | 86 | @Operation(summary = "查询角色字典", description = "查询角色字典列表")
|
81 | 87 | @GetMapping("/dict/role")
|
82 |
| - public R<List<LabelValueVO<Long>>> listRoleDict(@Validated RoleQuery query, @Validated SortQuery sortQuery) { |
| 88 | + public R<List<LabelValueVO<Long>>> listRoleDict(RoleQuery query, SortQuery sortQuery) { |
83 | 89 | List<RoleVO> list = roleService.list(query, sortQuery);
|
84 | 90 | List<LabelValueVO<Long>> labelValueVOList = roleService.buildDict(list);
|
85 | 91 | return R.ok(labelValueVOList);
|
|
0 commit comments