You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
2.0 KiB
63 lines
2.0 KiB
package com.wrj.driver.server.controller;
|
|
|
|
|
|
import com.wrj.driver.server.constant.Constants;
|
|
import com.wrj.driver.server.dto.TestQueryDto;
|
|
import com.wrj.driver.server.dto.TestSubmitDto;
|
|
import com.wrj.driver.server.response.BaseResponse;
|
|
import com.wrj.driver.server.service.IWrjQuestionTestService;
|
|
import com.wrj.driver.server.util.SecurityUtil;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import javax.validation.Valid;
|
|
|
|
/**
|
|
* <p>
|
|
* 模拟考试成绩表; 前端控制器
|
|
* </p>
|
|
*
|
|
* @author Automated procedures
|
|
* @since 2023-08-10
|
|
*/
|
|
@Api(tags = "考试")
|
|
@RestController
|
|
@RequestMapping("/wrjQuestionTest")
|
|
@Slf4j
|
|
public class WrjQuestionTestController {
|
|
|
|
@Autowired
|
|
private IWrjQuestionTestService testService;
|
|
|
|
@ApiOperation("提交考试成绩")
|
|
@PostMapping("/testSubmit")
|
|
public BaseResponse testSubmit(@RequestBody @Valid TestSubmitDto submitDto) {
|
|
log.info("考试成绩======>submitDto:{}", submitDto);
|
|
return testService.testSubmit(submitDto);
|
|
}
|
|
|
|
|
|
@ApiOperation("获取模拟考试主键")
|
|
@GetMapping("/getTestId")
|
|
public BaseResponse getTestId() {
|
|
log.info("获取模拟考试id======>userId:{}", SecurityUtil.getUserId());
|
|
return BaseResponse.success(testService.getTestId());
|
|
}
|
|
|
|
@ApiOperation("获取考试统计")
|
|
@PostMapping("/testTotal")
|
|
public BaseResponse testTotal(@RequestBody @Valid TestQueryDto queryDto) {
|
|
log.info("考试统计查询======>queryDto:{}", queryDto);
|
|
return BaseResponse.success(testService.testTotal(queryDto));
|
|
}
|
|
|
|
@ApiOperation("查询考斯成绩")
|
|
@PostMapping("/getTestScore")
|
|
public BaseResponse getTestScore(@RequestBody @Valid TestQueryDto queryDto) {
|
|
log.info("获取考试成绩======>queryDto:{}", queryDto);
|
|
return BaseResponse.success(testService.getTestScore(queryDto));
|
|
}
|
|
}
|
|
|