“djh”
6 天以前 5ca4ab349909030e77354832287f2d6a2c80e119
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
package com.gkhy.exam.admin.controller.app;
 
 
import com.gkhy.exam.common.api.CommonResult;
import com.gkhy.exam.system.domain.ExPaperStudent;
import com.gkhy.exam.system.service.ExPaperStudentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
 
/**
 * <p>
 * 学员与考试关系表 前端控制器
 * </p>
 *
 * @author kzy
 * @since 2024-06-06 13:53:17
 */
@Api(tags = "APP学员与考卷关系前端控制器")
@RestController
@RequestMapping("/app/paper-student")
public class AppPaperStudentController {
    @Autowired
    private ExPaperStudentService paperStudentService;
 
    @PreAuthorize("hasAnyAuthority('train:exam:student')")
    @ApiOperation(value = "分页获取学员的试卷列表(分页)")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "pageNum", dataType = "int", required = false, value = "当前页,默认1"),
            @ApiImplicitParam(paramType = "query", name = "pageSize", dataType = "int", required = false, value = "每页数目,默认10")
    })
    @GetMapping("/list")
    public CommonResult list(ExPaperStudent paperStudent){
        return CommonResult.success(paperStudentService.selectPaperStudentListForStudent(paperStudent));
    }
 
//    @ApiOperation(value = "根据id查询学员试卷信息")
//    @GetMapping(value = { "/getPaperStudentById" })
//    public CommonResult getPaperStudentById(@RequestParam(value = "paperStudentId", required = true) Long paperStudentId)
//    {
//        return CommonResult.success(paperStudentService.selectPaperStudentById(paperStudentId));
//    }
 
//    @ApiOperation(value = "根据试卷id和学员id查询试卷信息")
//    @ApiImplicitParams({
//            @ApiImplicitParam(paramType = "query", name = "paperId", dataType = "long", required = true, value = "试卷id"),
//            @ApiImplicitParam(paramType = "query", name = "studentId", dataType = "long", required = true, value = "学员id")
//    })
//    @GetMapping(value = { "/getPaperStudentInfo" })
//    public CommonResult getPaperStudentInfo(ExPaperStudent paperStudent)
//    {
//        return CommonResult.success(paperStudentService.selectPaperStudentById(paperStudent));
//    }
 
 
    @PreAuthorize("hasAnyAuthority('train:exam:student')")
    @ApiOperation(value = "结束考试")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "id", dataType = "long", required = true, value = "学员与试卷关系id")
    })
    @PostMapping(value = { "/endExam" })
    public CommonResult endExam(@RequestBody ExPaperStudent paperStudent)
    {
        paperStudentService.endExam(paperStudent);
        return CommonResult.success();
    }
}