package com.gkhy.exam.admin.controller.web;
|
|
|
import com.gkhy.exam.common.annotation.Log;
|
import com.gkhy.exam.common.annotation.RepeatSubmit;
|
import com.gkhy.exam.common.api.CommonResult;
|
import com.gkhy.exam.common.enums.BusinessType;
|
import com.gkhy.exam.system.domain.ExPaperStudent;
|
import com.gkhy.exam.system.domain.vo.BatchPaperStudentVO;
|
import com.gkhy.exam.system.domain.vo.ExPaperStudentVO;
|
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.validation.annotation.Validated;
|
import org.springframework.web.bind.annotation.*;
|
|
import java.util.Collections;
|
import java.util.List;
|
|
/**
|
* <p>
|
* 学员与考试关系表 前端控制器
|
* </p>
|
*
|
* @author kzy
|
* @since 2024-06-06 13:53:17
|
*/
|
@Api(tags = "学员与考试关系前端控制器")
|
@RestController
|
@RequestMapping("/paper-student")
|
public class ExPaperStudentController {
|
@Autowired
|
private ExPaperStudentService paperStudentService;
|
|
@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"),
|
@ApiImplicitParam(paramType = "query", name = "paperId", dataType = "long", required = true, value = "考卷id")
|
})
|
@GetMapping("/list")
|
public CommonResult list(ExPaperStudent paperStudent){
|
return CommonResult.success(paperStudentService.selectPaperStudentList(paperStudent));
|
}
|
|
@ApiOperation(value = "根据id查询学员试卷信息")
|
@GetMapping(value = { "/getPaperStudentById" })
|
public CommonResult getPaperStudentById(@RequestParam(value = "paperStudentId", required = true) Long paperStudentId)
|
{
|
return CommonResult.success(paperStudentService.selectPaperStudentById(paperStudentId));
|
}
|
|
@RepeatSubmit
|
@Log(title = "试卷与学员关系管理", businessType = BusinessType.INSERT)
|
@ApiOperation(value = "新增学员")
|
@PostMapping
|
public CommonResult add(@Validated @RequestBody ExPaperStudent paperStudent){
|
return CommonResult.success(paperStudentService.addPaperStudent(paperStudent));
|
}
|
|
@RepeatSubmit
|
@Log(title = "试卷与学员关系管理", businessType = BusinessType.INSERT)
|
@ApiOperation(value = "批量新增学员")
|
@PostMapping("/batchAdd")
|
public CommonResult batchAdd(@Validated @RequestBody BatchPaperStudentVO batchPaperStudent){
|
return CommonResult.success(paperStudentService.batchAddPaperStudent(batchPaperStudent));
|
}
|
|
@RepeatSubmit
|
@Log(title = "试卷与学员关系管理", businessType = BusinessType.DELETE)
|
@ApiOperation(value = "删除学员")
|
@DeleteMapping(value = { "/{phaseStudentId}" })
|
public CommonResult delete(@PathVariable(value = "phaseStudentId", required = true) Long paperStudentId){
|
return CommonResult.success(paperStudentService.deletePaperStudent(paperStudentId));
|
}
|
|
@RepeatSubmit
|
@Log(title = "试卷与学员关系管理", businessType = BusinessType.DELETE)
|
@ApiOperation(value = "批量删除学员")
|
@DeleteMapping(value = { "/batchDelete" })
|
public CommonResult batchDelete(@RequestBody List<Long> paperStudentIds){
|
paperStudentService.batchDeletePaperStudent(paperStudentIds);
|
return CommonResult.success();
|
}
|
|
@ApiOperation(value = "校验学员是否已存在")
|
@PostMapping("/checkStudentUnique")
|
public CommonResult checkNameUnique(@RequestBody ExPaperStudent paperStudent)
|
{
|
paperStudentService.checkStudentUnique(Collections.singletonList(paperStudent));
|
return CommonResult.success();
|
}
|
|
|
@ApiOperation(value = "提交批改试卷")
|
@PostMapping("/doReview")
|
public CommonResult doReview(@RequestBody ExPaperStudentVO paperStudentVO)
|
{
|
paperStudentService.doReview(paperStudentVO);
|
return CommonResult.success();
|
}
|
}
|