首页>代码>基于SpringBoot+Vue实现的在线考试系统>/OnlineExamSystem/OnlineExamSystemApi/src/main/java/com/rabbiter/oes/controller/AnswerController.java
package com.rabbiter.oes.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.rabbiter.oes.entity.ApiResult; import com.rabbiter.oes.serviceimpl.AnswerServiceImpl; import com.rabbiter.oes.util.ApiResultHandler; import com.rabbiter.oes.vo.AnswerVO; import com.rabbiter.oes.vo.QuestionVO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RestController; @RestController public class AnswerController { @Autowired private AnswerServiceImpl answerService; @GetMapping("/answers/{page}/{size}/{subject}/{section}/{question}") public ApiResult findAllQuestion( @PathVariable("page") Integer page, @PathVariable("size") Integer size, @PathVariable("subject") String subject, @PathVariable("section") String section, @PathVariable("question") String question){ Page<AnswerVO> answerVOPage = new Page<>(page,size); IPage<AnswerVO> answerVOIPage = answerService.findAll(answerVOPage, subject, section, question); return ApiResultHandler.buildApiResult(200,"查询所有题库", answerVOIPage); } /** * 根据类型和id获取题目 * * @param type 类型 * @param questionId 题目id * @return 题目信息 */ @GetMapping("/answers/{type}/{questionId}") public ApiResult findByIdAndType( @PathVariable("type") String type, @PathVariable("questionId") Long questionId ) { QuestionVO questionVO = answerService.findByIdAndType(type, questionId); return ApiResultHandler.buildApiResult(200, "查询题目", questionVO); } }
最近下载更多
dapeng0011 LV13
4月6日
微信网友_6927932988952576 LV12
3月30日
zolscy LV12
3月24日
2206371875 LV7
3月14日
3263394665 LV9
3月10日
wanglinddad LV55
3月7日
qqttuu LV3
3月6日
gnnhka LV10
3月4日
haozhilang LV8
2月27日
Boss绝 LV9
2月26日
最近浏览更多
chirsbey2
5月10日
暂无贡献等级
kenhomeliu LV29
4月30日
JiangYing009 LV8
4月27日
1230123 LV1
4月21日
qianhui1 LV3
4月18日
做自己的太阳 LV11
4月17日
dhcpsl LV2
4月10日
wmxhahah LV7
4月8日
dapeng0011 LV13
4月6日
微信网友_6927932988952576 LV12
3月30日