From b9782faeaef349d364afa1ed103cac67bc6bbac7 Mon Sep 17 00:00:00 2001 From: wanghu Date: Fri, 11 Sep 2026 12:21:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=A6=E7=94=9F=E6=95=99=E5=B8=88=E6=A0=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/oapi/oa/SchGroupController.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/yunhai/bschclassmanage/controller/oapi/oa/SchGroupController.java b/src/main/java/com/yunhai/bschclassmanage/controller/oapi/oa/SchGroupController.java index 419300e..24b4d77 100644 --- a/src/main/java/com/yunhai/bschclassmanage/controller/oapi/oa/SchGroupController.java +++ b/src/main/java/com/yunhai/bschclassmanage/controller/oapi/oa/SchGroupController.java @@ -9,6 +9,7 @@ import com.yunhai.bschclassmanage.model.vo.oa.SchInfoVO; import com.yunhai.bschclassmanage.service.IComSchTreeService; import com.yunhai.bschclassmanage.service.ISchInfoService; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import java.util.Collections; @@ -28,26 +29,26 @@ public class SchGroupController { @GetMapping("GetTeaTree") @Operation(summary = "获取学校教师组树(toUser 默认 true 带教师,false 仅返回组骨架;SchSerID 与 schId 二选一)") - public List getTeaTree(@RequestParam(value = "SchSerID", required = false) String SchSerID, - @RequestParam(value = "schId", required = false) Integer schId, - @RequestParam(value = "toUser", required = false, defaultValue = "true") boolean toUser) { + public ResponseEntity> getTeaTree(@RequestParam(value = "SchSerID", required = false) String SchSerID, + @RequestParam(value = "schId", required = false) Integer schId, + @RequestParam(value = "toUser", required = false, defaultValue = "true") boolean toUser) { Integer resolvedSchId = resolveSchId(schId, SchSerID); if (resolvedSchId == null) { - return Collections.emptyList(); + return ResponseEntity.ok(Collections.emptyList()); } - return comSchTreeService.getSchTeaTree(resolvedSchId, toUser); + return ResponseEntity.ok(comSchTreeService.getSchTeaTree(resolvedSchId, toUser)); } @GetMapping("GetStuTree") @Operation(summary = "获取学校学生树:学校→学段→年级→班级→学生(toUser 默认 true 带学生,false 仅返回组织骨架;SchSerID 与 schId 二选一)") - public List getStuTree(@RequestParam(value = "SchSerID", required = false) String SchSerID, + public ResponseEntity> getStuTree(@RequestParam(value = "SchSerID", required = false) String SchSerID, @RequestParam(value = "schId", required = false) Integer schId, @RequestParam(value = "toUser", required = false, defaultValue = "true") boolean toUser) { Integer resolvedSchId = resolveSchId(schId, SchSerID); if (resolvedSchId == null) { - return Collections.emptyList(); + return ResponseEntity.ok(Collections.emptyList()); } - return comSchTreeService.getSchStuTree(resolvedSchId, toUser); + return ResponseEntity.ok(comSchTreeService.getSchStuTree(resolvedSchId, toUser)); } /**