This commit is contained in:
parent
b012e228f7
commit
93f8534643
|
|
@ -20,7 +20,7 @@ import java.util.*;
|
||||||
*/
|
*/
|
||||||
@Api("练习")
|
@Api("练习")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/api/v1/practice")
|
@RequestMapping("/api")
|
||||||
public class ApiPracticeController extends BaseController {
|
public class ApiPracticeController extends BaseController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|
@ -36,7 +36,7 @@ public class ApiPracticeController extends BaseController {
|
||||||
private IExamUserErrorQuestionService examUserErrorQuestionService;
|
private IExamUserErrorQuestionService examUserErrorQuestionService;
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/list")
|
@GetMapping("/v1/practice/list")
|
||||||
public AjaxResult list(ExamPractice examPractice) {
|
public AjaxResult list(ExamPractice examPractice) {
|
||||||
|
|
||||||
List<ExamPractice> list = examPracticeService.selectListFromWeb(examPractice);
|
List<ExamPractice> list = examPracticeService.selectListFromWeb(examPractice);
|
||||||
|
|
@ -50,7 +50,7 @@ public class ApiPracticeController extends BaseController {
|
||||||
* @param map
|
* @param map
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("/info")
|
@GetMapping("/v1/practice/info")
|
||||||
public AjaxResult queryOne(@RequestParam Map<String,Object> map) {
|
public AjaxResult queryOne(@RequestParam Map<String,Object> map) {
|
||||||
List<ExamQuestionVO> result = examQuestionService.selectQuestionListByPracticeId(map);
|
List<ExamQuestionVO> result = examQuestionService.selectQuestionListByPracticeId(map);
|
||||||
if(map.containsKey("disorder")&&map.get("disorder").toString().equals("1")){
|
if(map.containsKey("disorder")&&map.get("disorder").toString().equals("1")){
|
||||||
|
|
@ -62,11 +62,13 @@ public class ApiPracticeController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 回答问题
|
* 保存错题记录
|
||||||
|
* @description 练习时答错题就保存到错题记录中
|
||||||
|
* 传入问题id
|
||||||
* @param answers
|
* @param answers
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/answer")
|
@PostMapping("/v1/practice/answer")
|
||||||
public AjaxResult answer(@RequestBody List<Map<String,Object>> answers) {
|
public AjaxResult answer(@RequestBody List<Map<String,Object>> answers) {
|
||||||
int error = 0;
|
int error = 0;
|
||||||
for (Map<String, Object> answer : answers) {
|
for (Map<String, Object> answer : answers) {
|
||||||
|
|
@ -89,11 +91,11 @@ public class ApiPracticeController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询错题本列表
|
* 查询我的错题列表
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("/queryerror")
|
@GetMapping("/v1/practice/{userId}/error")
|
||||||
public AjaxResult answer() {
|
public AjaxResult answer(@PathVariable("userId") String userId) {
|
||||||
ExamUserErrorQuestion examUserErrorQuestion = new ExamUserErrorQuestion();
|
ExamUserErrorQuestion examUserErrorQuestion = new ExamUserErrorQuestion();
|
||||||
examUserErrorQuestion.setVipUserId(Integer.parseInt(ShiroUtils.getUserId().toString()));
|
examUserErrorQuestion.setVipUserId(Integer.parseInt(ShiroUtils.getUserId().toString()));
|
||||||
List<ExamUserErrorQuestionVO> list = examUserErrorQuestionService.selectExamUserErrorQuestionDetailPage(examUserErrorQuestion);
|
List<ExamUserErrorQuestionVO> list = examUserErrorQuestionService.selectExamUserErrorQuestionDetailPage(examUserErrorQuestion);
|
||||||
|
|
@ -104,12 +106,12 @@ public class ApiPracticeController extends BaseController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询问题详情
|
* 查询问题详情
|
||||||
* @param questionId
|
* @param id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("/queryquestion/{id}")
|
@GetMapping("/v1/practice/question/{id}")
|
||||||
public AjaxResult queryQuestion(@PathVariable("id") String questionId) {
|
public AjaxResult queryQuestion(@PathVariable("id") String id) {
|
||||||
ExamQuestionVO result = examQuestionService.selectQuestionDetail(questionId);
|
ExamQuestionVO result = examQuestionService.selectQuestionDetail(id);
|
||||||
AjaxResult success = success("查询成功");
|
AjaxResult success = success("查询成功");
|
||||||
success.put("data",result);
|
success.put("data",result);
|
||||||
return success;
|
return success;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue