@@ -20,11 +20,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/** Compatibility endpoints used by BestSchool.IBaseClass.BLL.DbClass consumers. */
|
||||
@@ -43,7 +39,7 @@ public class DbClassController {
|
||||
public ResponseEntity<List<Map<String, Object>>> getSchteaList(
|
||||
@Parameter(description = "School ID", required = true, example = "3")
|
||||
@RequestParam("Group") Integer group) {
|
||||
if (group == null || group <= 0) return ResponseEntity.badRequest().build();
|
||||
if (group == null || group <= 0) return ResponseEntity.ok(new ArrayList<>());
|
||||
|
||||
SchInfoVO school = schInfoService.GetSchFirst(group);
|
||||
String schSerId = school == null
|
||||
|
||||
@@ -52,7 +52,7 @@ public class TeainfoController {
|
||||
public ResponseEntity<TeaInfoVO> getTeainfo(@RequestParam Integer uid) {
|
||||
// 1. 鍙傛暟鏍¢獙
|
||||
if (uid == null) {
|
||||
return ResponseEntity.badRequest().build();
|
||||
return ResponseEntity.ok(new TeaInfoVO());
|
||||
}
|
||||
|
||||
// 2. 鐩存帴浣跨敤 uid 鏌ヨ
|
||||
@@ -63,7 +63,7 @@ public class TeainfoController {
|
||||
})
|
||||
.map(this::convertToTeaInfoVO)
|
||||
.map(ResponseEntity::ok)
|
||||
.orElse(ResponseEntity.notFound().build());
|
||||
.orElse(ResponseEntity.ok(new TeaInfoVO()));
|
||||
}
|
||||
|
||||
private TeaInfoVO convertToTeaInfoVO(SchTeacher teacher) {
|
||||
@@ -134,7 +134,7 @@ public class TeainfoController {
|
||||
public ResponseEntity<List<TeaInfoVO>> getArrTeainfo(@RequestBody String userIds) {
|
||||
// 1. 鍙傛暟鏍¢獙
|
||||
if (userIds == null) {
|
||||
return ResponseEntity.badRequest().build();
|
||||
return ResponseEntity.ok(new ArrayList<>());
|
||||
}
|
||||
|
||||
List<Integer> uids= Arrays.asList(OtherUtil.convertToArray(userIds));
|
||||
@@ -146,7 +146,7 @@ public class TeainfoController {
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
return voList.isEmpty() ? ResponseEntity.noContent().build() : ResponseEntity.ok(voList);
|
||||
return ResponseEntity.ok(voList);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -174,7 +174,7 @@ public class TeainfoController {
|
||||
// 1. 参数校验:SchSerID 与 schId 至少传一个
|
||||
Integer resolvedSchId = resolveSchId(schId, SchSerID);
|
||||
if (resolvedSchId == null) {
|
||||
return ResponseEntity.badRequest().build();
|
||||
return ResponseEntity.ok(new ArrayList<>());
|
||||
}
|
||||
|
||||
List<SchTeacher> teachers = schTeacherService.getSchTeacherList(resolvedSchId);
|
||||
|
||||
@@ -52,12 +52,12 @@ public class UserInfoController {
|
||||
public ResponseEntity<List<UserInfoVO>> getUserList(@RequestParam String SchSerID) {
|
||||
// 1. 鍙傛暟鏍¢獙
|
||||
if (SchSerID == null || SchSerID.trim().isEmpty()) {
|
||||
return ResponseEntity.badRequest().build();
|
||||
return ResponseEntity.ok(new ArrayList<>());
|
||||
}
|
||||
|
||||
SchInfoVO schInfoVO = schInfoService.GetSchFirst(SchSerID);
|
||||
if (schInfoVO == null) {
|
||||
return ResponseEntity.badRequest().build();
|
||||
return ResponseEntity.ok(new ArrayList<>());
|
||||
}
|
||||
Integer schId = schInfoVO.getUserSchSerId();
|
||||
|
||||
@@ -81,7 +81,7 @@ public class UserInfoController {
|
||||
}
|
||||
|
||||
// 4. 杩斿洖缁撴灉
|
||||
return voList.isEmpty() ? ResponseEntity.noContent().build() : ResponseEntity.ok(voList);
|
||||
return ResponseEntity.ok(voList);
|
||||
}
|
||||
|
||||
// ===== 杞崲鏁欏笀 =====
|
||||
@@ -157,7 +157,7 @@ public class UserInfoController {
|
||||
@Operation(summary = "getUserIdList")
|
||||
public ResponseEntity<List<UserInfoVO>> getUserIdList(@RequestParam Integer userid) {
|
||||
if (userid == null) {
|
||||
return ResponseEntity.badRequest().build();
|
||||
return ResponseEntity.ok(new ArrayList<>());
|
||||
}
|
||||
|
||||
Optional<SchTeacher> teacherOpt = schTeacherRepository.findByTeaId(userid);
|
||||
@@ -175,8 +175,7 @@ public class UserInfoController {
|
||||
return ResponseEntity.ok(Collections.singletonList(vo));
|
||||
}
|
||||
}
|
||||
|
||||
return ResponseEntity.notFound().build();
|
||||
return ResponseEntity.ok(new ArrayList<>());
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user