|
@@ -353,32 +353,34 @@ public class ExamStudentController extends ControllerSupport {
|
|
|
return new ResponseEntity<ExamStudent>(examStudentRepo.save(examStudent), HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 方法注释
|
|
|
+ *
|
|
|
+ * @author WANGWEI
|
|
|
+ * @param ids
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@ApiOperation(value = "按ID删除考试学生", notes = "删除")
|
|
|
- @DeleteMapping("/{id}")
|
|
|
- public ResponseEntity deleteExamStudent(@PathVariable String id) {
|
|
|
- List<Long> examStuIds = Stream.of(id.split(",")).map(s -> Long.parseLong(s.trim()))
|
|
|
+ @DeleteMapping("/{ids}")
|
|
|
+ public List<Long> deleteExamStudent(@PathVariable String ids) {
|
|
|
+ List<Long> examStuIds = Stream.of(ids.split(",")).map(s -> Long.parseLong(s.trim()))
|
|
|
.collect(Collectors.toList());
|
|
|
- try {
|
|
|
- examStudentService.deleteExamStudent(examStuIds);
|
|
|
- return new ResponseEntity(HttpStatus.OK);
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("删除失败:", e);
|
|
|
- return new ResponseEntity(new ErrorMsg(e.getMessage()),
|
|
|
- HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
- }
|
|
|
+ examStudentService.deleteExamStudent(examStuIds);
|
|
|
+ return examStuIds;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 方法注释
|
|
|
+ *
|
|
|
+ * @author WANGWEI
|
|
|
+ * @param examId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@ApiOperation(value = "按考试删除考试学生", notes = "按考试删除")
|
|
|
@DeleteMapping("/exam/{examId}")
|
|
|
- public ResponseEntity deleteExamStudents(@PathVariable Long examId) {
|
|
|
- try {
|
|
|
- examStudentService.deleteExamStudents(examId);
|
|
|
- return new ResponseEntity(HttpStatus.OK);
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("删除失败:", e);
|
|
|
- return new ResponseEntity(new ErrorMsg(e.getMessage()),
|
|
|
- HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
- }
|
|
|
+ public Long deleteExamStudents(@PathVariable Long examId) {
|
|
|
+ examStudentService.deleteExamStudents(examId);
|
|
|
+ return examId;
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "导入考试学生", notes = "导入")
|