| | |
| | | package com.ycl.jxkg.controller.admin; |
| | | |
| | | import com.ycl.jxkg.group.Update; |
| | | import com.ycl.jxkg.base.Result; |
| | | import com.ycl.jxkg.domain.form.AddTimeForm; |
| | | import com.ycl.jxkg.domain.form.ExamForm; |
| | | import com.ycl.jxkg.domain.form.ForceSubmitForm; |
| | | import com.ycl.jxkg.domain.query.ExamQuery; |
| | | import com.ycl.jxkg.domain.vo.admin.exam.ExamPaperMarkVO; |
| | | import com.ycl.jxkg.group.Add; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import lombok.RequiredArgsConstructor; |
| | | import java.util.List; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import javax.validation.constraints.NotEmpty; |
| | | import com.ycl.jxkg.group.Update; |
| | | import com.ycl.jxkg.service.ExamService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import com.ycl.jxkg.service.ExamService; |
| | | import com.ycl.jxkg.base.Result; |
| | | import com.ycl.jxkg.domain.form.ExamForm; |
| | | import com.ycl.jxkg.domain.query.ExamQuery; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.constraints.NotEmpty; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 考试 前端控制器 |
| | |
| | | @RequiredArgsConstructor |
| | | @Api(value = "考试", tags = "考试管理") |
| | | @RestController |
| | | @RequestMapping("/api/exam") |
| | | @RequestMapping("/api/admin/exam") |
| | | public class ExamController { |
| | | |
| | | private final ExamService examService; |
| | |
| | | public Result list() { |
| | | return examService.all(); |
| | | } |
| | | |
| | | @GetMapping("/mark/paper/{id}") |
| | | @PreAuthorize("hasAuthority('exam:markPaper')") |
| | | @ApiOperation(value = "获取考试结果信息", notes = "获取考试结果信息") |
| | | public Result getMarkResultInfo(@PathVariable("id") Integer id) { |
| | | return examService.getMarkResultInfo(id); |
| | | } |
| | | |
| | | @GetMapping("/mark/paper/{examId}/{userId}") |
| | | @PreAuthorize("hasAuthority('exam:markPaper')") |
| | | @ApiOperation(value = "获取阅卷信息", notes = "获取阅卷信息") |
| | | public Result getMarkPaperInfo(@PathVariable("examId") Integer examId, @PathVariable("userId") Integer userId) { |
| | | return examService.getMarkPaperInfo(examId, userId); |
| | | } |
| | | |
| | | @PostMapping("/mark/paper") |
| | | @ApiOperation(value = "提交批改", notes = "提交批改") |
| | | public Result submitMarkPaper(@RequestBody ExamPaperMarkVO form) { |
| | | return examService.submitMarkPaper(form); |
| | | } |
| | | |
| | | @GetMapping("/monitor/list") |
| | | @PreAuthorize("hasAuthority('exam:monitor:list')") |
| | | @ApiOperation(value = "考试监控列表", notes = "考试监控列表") |
| | | public Result monitorList(ExamQuery query) { |
| | | return examService.monitorList(query); |
| | | } |
| | | |
| | | @PostMapping("/add/time") |
| | | @PreAuthorize("hasAuthority('exam:add:time')") |
| | | @ApiOperation(value = "添加考试时长", notes = "添加考试时长") |
| | | public Result addTime(@RequestBody @Validated AddTimeForm form) { |
| | | return examService.addTime(form); |
| | | } |
| | | |
| | | @PostMapping("/force/submit") |
| | | @PreAuthorize("hasAuthority('exam:add:time')") |
| | | @ApiOperation(value = "强制提交试卷", notes = "强制提交试卷") |
| | | public Result forceSubmit(@RequestBody @Validated ForceSubmitForm form) { |
| | | return examService.forceSubmit(form); |
| | | } |
| | | |
| | | } |