|
@@ -43,7 +43,6 @@ import java.util.concurrent.ConcurrentHashMap;
|
|
@RestController
|
|
@RestController
|
|
@RequestMapping("/${prefix.url.exam}/exam")
|
|
@RequestMapping("/${prefix.url.exam}/exam")
|
|
public class TEExamController {
|
|
public class TEExamController {
|
|
- private final static Logger log = LoggerFactory.getLogger(TEExamController.class);
|
|
|
|
|
|
|
|
@Resource
|
|
@Resource
|
|
TEExamService teExamService;
|
|
TEExamService teExamService;
|
|
@@ -92,7 +91,6 @@ public class TEExamController {
|
|
@RequestMapping(value = "/prepare", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/prepare", method = RequestMethod.POST)
|
|
@ApiResponses({@ApiResponse(code = 200, message = "试卷信息")})
|
|
@ApiResponses({@ApiResponse(code = 200, message = "试卷信息")})
|
|
public Result prepare(@RequestBody PrepareParamBean param) {
|
|
public Result prepare(@RequestBody PrepareParamBean param) {
|
|
- log.info("PrepareParamBean:{}",JacksonUtil.parseJson(param));
|
|
|
|
TEStudentCacheDto teStudent = (TEStudentCacheDto) ServletUtil.getRequestStudentAccount();
|
|
TEStudentCacheDto teStudent = (TEStudentCacheDto) ServletUtil.getRequestStudentAccount();
|
|
String lockKey = SystemConstant.REDIS_LOCK_STUDENT_PREFIX + teStudent.getId();
|
|
String lockKey = SystemConstant.REDIS_LOCK_STUDENT_PREFIX + teStudent.getId();
|
|
Boolean lock = redisUtil.lock(lockKey, SystemConstant.REDIS_CACHE_TIME_OUT);
|
|
Boolean lock = redisUtil.lock(lockKey, SystemConstant.REDIS_CACHE_TIME_OUT);
|
|
@@ -113,7 +111,6 @@ public class TEExamController {
|
|
@RequestMapping(value = "/start", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/start", method = RequestMethod.POST)
|
|
@ApiResponses({@ApiResponse(code = 200, message = "试卷信息")})
|
|
@ApiResponses({@ApiResponse(code = 200, message = "试卷信息")})
|
|
public Result start(@RequestBody ExamStartParamBean param) {
|
|
public Result start(@RequestBody ExamStartParamBean param) {
|
|
- log.info("ExamStartParamBean:{}",JacksonUtil.parseJson(param));
|
|
|
|
TEStudentCacheDto teStudent = (TEStudentCacheDto) ServletUtil.getRequestStudentAccount();
|
|
TEStudentCacheDto teStudent = (TEStudentCacheDto) ServletUtil.getRequestStudentAccount();
|
|
String lockKey = SystemConstant.REDIS_LOCK_STUDENT_PREFIX + teStudent.getId();
|
|
String lockKey = SystemConstant.REDIS_LOCK_STUDENT_PREFIX + teStudent.getId();
|
|
Boolean lock = redisUtil.lock(lockKey, SystemConstant.REDIS_CACHE_TIME_OUT);
|
|
Boolean lock = redisUtil.lock(lockKey, SystemConstant.REDIS_CACHE_TIME_OUT);
|
|
@@ -155,7 +152,6 @@ public class TEExamController {
|
|
@RequestMapping(value = "/student_paper_struct/upload", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/student_paper_struct/upload", method = RequestMethod.POST)
|
|
@ApiResponses({@ApiResponse(code = 200, message = "试卷信息")})
|
|
@ApiResponses({@ApiResponse(code = 200, message = "试卷信息")})
|
|
public Result studentPaperStruct(@RequestBody StudentPaperStructParamBean param) {
|
|
public Result studentPaperStruct(@RequestBody StudentPaperStructParamBean param) {
|
|
- log.info("StudentPaperStructParamBean:{}",JacksonUtil.parseJson(param));
|
|
|
|
TEStudentCacheDto teStudent = (TEStudentCacheDto) ServletUtil.getRequestStudentAccount();
|
|
TEStudentCacheDto teStudent = (TEStudentCacheDto) ServletUtil.getRequestStudentAccount();
|
|
if (param.getRecordId() == null) {
|
|
if (param.getRecordId() == null) {
|
|
throw new BusinessException("考试记录id不能为空");
|
|
throw new BusinessException("考试记录id不能为空");
|
|
@@ -171,7 +167,6 @@ public class TEExamController {
|
|
@RequestMapping(value = "/answer/submit", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/answer/submit", method = RequestMethod.POST)
|
|
@ApiResponses({@ApiResponse(code = 200, message = "试卷信息")})
|
|
@ApiResponses({@ApiResponse(code = 200, message = "试卷信息")})
|
|
public Result answerSubmit(@RequestBody AnswerSubmitParamBean param) {
|
|
public Result answerSubmit(@RequestBody AnswerSubmitParamBean param) {
|
|
- log.info("AnswerSubmitParamBean:{}",JacksonUtil.parseJson(param));
|
|
|
|
TEStudentCacheDto teStudent = (TEStudentCacheDto) ServletUtil.getRequestStudentAccount();
|
|
TEStudentCacheDto teStudent = (TEStudentCacheDto) ServletUtil.getRequestStudentAccount();
|
|
if (param.getRecordId() == null) {
|
|
if (param.getRecordId() == null) {
|
|
throw new BusinessException("考试记录id不能为空");
|
|
throw new BusinessException("考试记录id不能为空");
|
|
@@ -198,7 +193,6 @@ public class TEExamController {
|
|
@RequestMapping(value = "/audio_left_play_count/submit", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/audio_left_play_count/submit", method = RequestMethod.POST)
|
|
@ApiResponses({@ApiResponse(code = 200, message = "试卷信息")})
|
|
@ApiResponses({@ApiResponse(code = 200, message = "试卷信息")})
|
|
public Result audioLeftPlayCountSubmit(@RequestBody AudioLeftPlayCountSubmitParamBean param) {
|
|
public Result audioLeftPlayCountSubmit(@RequestBody AudioLeftPlayCountSubmitParamBean param) {
|
|
- log.info("AudioLeftPlayCountSubmitParamBean:{}",JacksonUtil.parseJson(param));
|
|
|
|
TEStudentCacheDto teStudent = (TEStudentCacheDto) ServletUtil.getRequestStudentAccount();
|
|
TEStudentCacheDto teStudent = (TEStudentCacheDto) ServletUtil.getRequestStudentAccount();
|
|
if (param.getRecordId() == null) {
|
|
if (param.getRecordId() == null) {
|
|
throw new BusinessException("考试记录id不能为空");
|
|
throw new BusinessException("考试记录id不能为空");
|
|
@@ -227,7 +221,6 @@ public class TEExamController {
|
|
@RequestMapping(value = "/resume", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/resume", method = RequestMethod.POST)
|
|
@ApiResponses({@ApiResponse(code = 200, message = "试卷信息")})
|
|
@ApiResponses({@ApiResponse(code = 200, message = "试卷信息")})
|
|
public Result resume(@RequestBody ResumeParamBean param) {
|
|
public Result resume(@RequestBody ResumeParamBean param) {
|
|
- log.info("ResumeParamBean:{}",JacksonUtil.parseJson(param));
|
|
|
|
TEStudentCacheDto teStudent = (TEStudentCacheDto) ServletUtil.getRequestStudentAccount();
|
|
TEStudentCacheDto teStudent = (TEStudentCacheDto) ServletUtil.getRequestStudentAccount();
|
|
String lockKey = SystemConstant.REDIS_LOCK_STUDENT_PREFIX + teStudent.getId();
|
|
String lockKey = SystemConstant.REDIS_LOCK_STUDENT_PREFIX + teStudent.getId();
|
|
Boolean lock = redisUtil.lock(lockKey, SystemConstant.REDIS_CACHE_TIME_OUT);
|
|
Boolean lock = redisUtil.lock(lockKey, SystemConstant.REDIS_CACHE_TIME_OUT);
|
|
@@ -248,7 +241,6 @@ public class TEExamController {
|
|
@RequestMapping(value = "/finish", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/finish", method = RequestMethod.POST)
|
|
@ApiResponses({@ApiResponse(code = 200, message = "试卷信息")})
|
|
@ApiResponses({@ApiResponse(code = 200, message = "试卷信息")})
|
|
public Result finish(@RequestBody FinishParamBean param) {
|
|
public Result finish(@RequestBody FinishParamBean param) {
|
|
- log.info("FinishParamBean:{}",JacksonUtil.parseJson(param));
|
|
|
|
TEStudentCacheDto teStudent = (TEStudentCacheDto) ServletUtil.getRequestStudentAccount();
|
|
TEStudentCacheDto teStudent = (TEStudentCacheDto) ServletUtil.getRequestStudentAccount();
|
|
String lockKey = SystemConstant.REDIS_LOCK_STUDENT_PREFIX + teStudent.getId();
|
|
String lockKey = SystemConstant.REDIS_LOCK_STUDENT_PREFIX + teStudent.getId();
|
|
Boolean lock = redisUtil.lock(lockKey, SystemConstant.REDIS_CACHE_TIME_OUT);
|
|
Boolean lock = redisUtil.lock(lockKey, SystemConstant.REDIS_CACHE_TIME_OUT);
|
|
@@ -285,11 +277,9 @@ public class TEExamController {
|
|
@RequestMapping(value = "/result", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/result", method = RequestMethod.POST)
|
|
@ApiResponses({@ApiResponse(code = 200, message = "试卷信息")})
|
|
@ApiResponses({@ApiResponse(code = 200, message = "试卷信息")})
|
|
public Result result(@RequestBody ResultParamBean param) {
|
|
public Result result(@RequestBody ResultParamBean param) {
|
|
- log.info("ResultParamBean:{}",JacksonUtil.parseJson(param));
|
|
|
|
if (param.getRecordId() == null) {
|
|
if (param.getRecordId() == null) {
|
|
throw new BusinessException("考试记录id不能为空");
|
|
throw new BusinessException("考试记录id不能为空");
|
|
}
|
|
}
|
|
return ResultUtil.ok(teExamService.result(param.getRecordId()));
|
|
return ResultUtil.ok(teExamService.result(param.getRecordId()));
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|