feat:在线考试接口

pg_adapter
wangxy 9 months ago
parent e2b77eb8d4
commit 4cdb6bdb33

@ -78,7 +78,7 @@ public class ExamController extends BaseController {
@Log(title = "考试", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(@Validated ExamSaveReqDTO reqDTO) {
public AjaxResult addSave(@RequestBody @Validated ExamSaveReqDTO reqDTO) {
return toAjax(examManager.saveOrUpdate(reqDTO));
}
@ -96,7 +96,7 @@ public class ExamController extends BaseController {
@Log(title = "考试", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(@Validated ExamSaveReqDTO reqDTO) {
public AjaxResult editSave(@RequestBody @Validated ExamSaveReqDTO reqDTO) {
return toAjax(examManager.saveOrUpdate(reqDTO));
}

@ -96,7 +96,7 @@ public class QuController extends BaseController {
@Log(title = "试题", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(@Validated QuDetailDTO reqDTO) {
public AjaxResult editSave(@RequestBody @Validated QuDetailDTO reqDTO) {
return toAjax(quManager.saveOrUpdate(reqDTO));
}

@ -82,6 +82,7 @@ public class ExamManager {
} else {
elExam.setCreateTime(new Date());
}
elExamService.saveOrUpdate(elExam);
if (CollUtil.isNotEmpty(reqDTO.getRepoList())) {
List<ElExamRepo> examRepos = Convert.toList(ElExamRepo.class, reqDTO.getRepoList());
examRepos.forEach(elExamRepo -> elExamRepo.setExamId(elExam.getId()));
@ -97,7 +98,7 @@ public class ExamManager {
});
elExamDepartService.saveBatch(list);
}
return elExamService.saveOrUpdate(elExam);
return true;
}

@ -83,6 +83,7 @@ public class QuManager {
} else {
qu.setCreateTime(new Date());
}
quService.saveOrUpdate(qu);
if(CollUtil.isNotEmpty(reqDTO.getAnswerList())){
List<ElQuAnswer> answerList = Convert.toList(ElQuAnswer.class, reqDTO.getAnswerList());
answerList.forEach(elQuAnswer -> elQuAnswer.setQuId(qu.getId()));
@ -100,7 +101,7 @@ public class QuManager {
quRepoService.saveBatch(list);
reqDTO.getRepoIds().forEach(this::sortRepo);
}
return quService.saveOrUpdate(qu);
return true;
}

Loading…
Cancel
Save