package jnpf.tmsController; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import jnpf.base.ActionResult; import jnpf.base.vo.PageListVO; import jnpf.base.vo.PaginationVO; import jnpf.tmsEntity.examgrade.TmsExamGradeDetailVO; import jnpf.tmsEntity.examgrade.TmsExamGradeExamVO; import jnpf.tmsEntity.examgrade.TmsExamGradeQuery; import jnpf.tmsEntity.examgrade.TmsExamGradeSessionVO; import jnpf.tmsEntity.examgrade.TmsExamGradeSubmitForm; import jnpf.tmsEntity.examgrade.TmsExamGradeSubmitResultVO; import jnpf.tmsService.TmsExamGradeService; import jnpf.util.JsonUtil; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.List; /** * 考试阅卷。网关 /api/tms/exam-grade/** (StripPrefix=2)→ /exam-grade/** */ @Tag(name = "TMS考试阅卷", description = "ExamGrade") @RestController @RequestMapping("/exam-grade") @RequiredArgsConstructor public class TmsExamGradeController { private final TmsExamGradeService examGradeService; @Operation(summary = "阅卷场次列表") @GetMapping("/sessions") public ActionResult> sessions(TmsExamGradeQuery query) { List list = examGradeService.getSessionList(query); PageListVO vo = new PageListVO<>(); vo.setList(list); vo.setPagination(JsonUtil.getJsonToBean(query, PaginationVO.class)); return ActionResult.success(vo); } @Operation(summary = "阅卷场次信息") @GetMapping("/sessions/{id}") public ActionResult session(@PathVariable("id") String id) { return ActionResult.success(examGradeService.getSession(id)); } @Operation(summary = "场次下答卷列表") @GetMapping("/sessions/{id}/exams") public ActionResult> exams(@PathVariable("id") String id) { return ActionResult.success(examGradeService.getExamList(id)); } @Operation(summary = "答卷阅卷详情") @GetMapping("/exams/{examId}") public ActionResult examDetail(@PathVariable("examId") String examId) { return ActionResult.success(examGradeService.getExamDetail(examId)); } @Operation(summary = "提交阅卷") @PostMapping("/exams/{examId}/submit") public ActionResult submit( @PathVariable("examId") String examId, @RequestBody TmsExamGradeSubmitForm form) { if (form == null) { form = new TmsExamGradeSubmitForm(); } form.setExamId(examId); return ActionResult.success(examGradeService.submitGrade(form)); } }