Commit ab6afd25 authored by Ryan Loong's avatar Ryan Loong

update 点名接口

parent 2d335dc2
...@@ -100,15 +100,12 @@ public class StudentInfoService { ...@@ -100,15 +100,12 @@ public class StudentInfoService {
* @return * @return
*/ */
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public StudentVo selectStudentInfo(Integer classId, Integer maxCall) { public List<StudentVo> selectStudentInfo(Integer classId, Integer maxCall) {
StudentVo record = beanSearcher.searchFirst(StudentVo.class, MapUtils.builder() return beanSearcher.searchAll(StudentVo.class, MapUtils.builder()
.field(StudentVo::getDeleted, StudentInfo.NOT_DELETED).op(Equal.class) .field(StudentVo::getDeleted, StudentInfo.NOT_DELETED).op(Equal.class)
.field(StudentVo::getClassId, classId).op(Equal.class) .field(StudentVo::getClassId, classId).op(Equal.class)
.field(StudentVo::getCallTimes, maxCall).op(LessThan.class) .field(StudentVo::getCallTimes, maxCall).op(LessThan.class)
.build()); .build());
increaseCallTime(record);
return record;
} }
/** /**
......
...@@ -38,8 +38,11 @@ public class StudentController { ...@@ -38,8 +38,11 @@ public class StudentController {
return ResponseUtil.ok(studentInfoService.selectStudentInfoByWeb(studentName, studentUniqueId, null, classId, page, limit, sort, order, minCall, maxCall)); return ResponseUtil.ok(studentInfoService.selectStudentInfoByWeb(studentName, studentUniqueId, null, classId, page, limit, sort, order, minCall, maxCall));
} }
@GetMapping("randomSelect") @GetMapping("pointList")
public Object randomSelect(@RequestParam Integer classId, @Nullable @RequestParam Integer maxCall) { public Object pointList(@RequestParam Integer classId, @Nullable @RequestParam Integer maxCall) {
if (Objects.nonNull(maxCall) && maxCall <= 0) {
return ResponseUtil.badArgumentValue();
}
return ResponseUtil.ok(studentInfoService.selectStudentInfo(classId, maxCall)); return ResponseUtil.ok(studentInfoService.selectStudentInfo(classId, maxCall));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment