|
|
|
@ -1,6 +1,7 @@ |
|
|
|
|
package com.ccic.safeliab.web; |
|
|
|
|
|
|
|
|
|
import com.ccic.safeliab.entity.ExamPapers; |
|
|
|
|
import com.ccic.safeliab.entity.QuestionCategories; |
|
|
|
|
import com.ccic.safeliab.service.ExamPaperService; |
|
|
|
|
import com.ccic.safeliab.util.R; |
|
|
|
|
import com.ccic.safeliab.vo.InsExamPaperVO; |
|
|
|
@ -18,8 +19,8 @@ public class ExamPaperController { |
|
|
|
|
private ExamPaperService examPaperService; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 获取试题 |
|
|
|
|
* @param vo 题库对象(VO) |
|
|
|
|
* 获取试卷 |
|
|
|
|
* @param vo 试卷对象(VO) |
|
|
|
|
* @return 查询结果 |
|
|
|
|
*/ |
|
|
|
|
@PostMapping("/list") |
|
|
|
@ -91,4 +92,18 @@ public class ExamPaperController { |
|
|
|
|
ExamPapers data = examPaperService.getDetail(id); |
|
|
|
|
return R.ok().data(data); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 随机获取试题 |
|
|
|
|
* @param vo 题库对象(VO) |
|
|
|
|
* @return 查询结果 |
|
|
|
|
*/ |
|
|
|
|
@PostMapping("/getRandomQuestions") |
|
|
|
|
public R getRandomQuestions(@RequestBody InsExamPaperVO vo) { |
|
|
|
|
ExamPapers entity = new ExamPapers(); |
|
|
|
|
entity.setIndustryId(vo.getIndustryId()); |
|
|
|
|
entity.setQuestionCount(vo.getQuestionCount()); |
|
|
|
|
List<QuestionCategories> data = examPaperService.getRandomQuestions(entity); |
|
|
|
|
return R.ok().data(data); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|