| | |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.ycl.jxkg.base.BaseApiController; |
| | | import com.ycl.jxkg.base.Result; |
| | | import com.ycl.jxkg.domain.entity.ExamPaperAnswer; |
| | | import com.ycl.jxkg.domain.vo.admin.exam.ExamPaperEditRequestVO; |
| | | import com.ycl.jxkg.domain.vo.admin.paper.ExamPaperAnswerPageRequestVO; |
| | | import com.ycl.jxkg.domain.vo.student.exam.ExamPaperReadVO; |
| | | import com.ycl.jxkg.domain.vo.student.exam.ExamPaperSubmitVO; |
| | | import com.ycl.jxkg.domain.vo.student.exampaper.ExamPaperAnswerPageResponseVO; |
| | | import com.ycl.jxkg.service.ExamPaperAnswerService; |
| | | import com.ycl.jxkg.service.SubjectService; |
| | | import com.ycl.jxkg.service.UserService; |
| | | import com.ycl.jxkg.service.ExamPaperService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | public class ExamPaperAnswerController extends BaseApiController { |
| | | |
| | | private final ExamPaperAnswerService examPaperAnswerService; |
| | | private final SubjectService subjectService; |
| | | private final UserService userService; |
| | | private final ExamPaperService examPaperService; |
| | | |
| | | @PostMapping("/pageExamPaper") |
| | | public Result<PageInfo<ExamPaperAnswerPageResponseVO>> pageExamPaper(@RequestBody ExamPaperAnswerPageRequestVO model) { |
| | |
| | | return Result.ok(examPaperAnswerService.adminPage(model)); |
| | | } |
| | | |
| | | @PostMapping("/read/{id}") |
| | | public Result<ExamPaperReadVO> read(@PathVariable Integer id) { |
| | | ExamPaperAnswer examPaperAnswer = examPaperAnswerService.getById(id); |
| | | ExamPaperReadVO vm = new ExamPaperReadVO(); |
| | | ExamPaperEditRequestVO paper = examPaperService.examPaperToVM(examPaperAnswer.getExamPaperId()); |
| | | ExamPaperSubmitVO answer = examPaperAnswerService.examPaperAnswerToVM(examPaperAnswer.getId()); |
| | | vm.setPaper(paper); |
| | | vm.setAnswer(answer); |
| | | return Result.ok(vm); |
| | | } |
| | | |
| | | } |