mirror of
https://github.com/PlayEdu/PlayEdu
synced 2025-12-20 02:25:39 +08:00
优化资源上传和记录存储
This commit is contained in:
@@ -45,8 +45,12 @@ public class DepartmentController {
|
||||
|
||||
@BackendPermissionMiddleware(slug = BPermissionConstant.DEPARTMENT_STORE)
|
||||
@GetMapping("/create")
|
||||
public JsonResponse create(@RequestParam(name = "parent_id", defaultValue = "0") Integer parentId) {
|
||||
List<Department> data = departmentService.listByParentId(parentId);
|
||||
public JsonResponse create() {
|
||||
Map<Integer, List<Department>> departments = departmentService.all().stream().collect(Collectors.groupingBy(Department::getParentId));
|
||||
|
||||
HashMap<String, Object> data = new HashMap<>();
|
||||
data.put("departments", departments);
|
||||
|
||||
return JsonResponse.data(data);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user