main
tamguo 7 years ago
parent 302ce66b78
commit e6f32c6b24

@ -35,9 +35,9 @@ public class QuestionContrller {
private ICourseService iCourseService; private ICourseService iCourseService;
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@RequestMapping(value = {"questionlist/{chapterId}-{offset}-{limit}.html"}, method = RequestMethod.GET) @RequestMapping(value = {"questionlist/{chapterId}-{current}-{size}.html"}, method = RequestMethod.GET)
public ModelAndView questionList(@PathVariable String chapterId , @PathVariable Integer offset , public ModelAndView questionList(@PathVariable String chapterId , @PathVariable Integer current ,
@PathVariable Integer limit , ModelAndView model){ @PathVariable Integer size , ModelAndView model){
try { try {
model.setViewName("questionList"); model.setViewName("questionList");
@ -48,8 +48,8 @@ public class QuestionContrller {
ChapterEntity nextChapter = iChapterService.selectById(chapter.getId()); ChapterEntity nextChapter = iChapterService.selectById(chapter.getId());
Page<QuestionEntity> page = new Page<>(); Page<QuestionEntity> page = new Page<>();
page.setCurrent(offset); page.setCurrent(current);
page.setSize(limit); page.setSize(size);
Page<QuestionEntity> questionList = iQuestionService.selectPage(page , Condition.create().eq("chapter_id", chapterId).orderDesc(Arrays.asList("id"))); Page<QuestionEntity> questionList = iQuestionService.selectPage(page , Condition.create().eq("chapter_id", chapterId).orderDesc(Arrays.asList("id")));
model.addObject("subject", subject); model.addObject("subject", subject);
model.addObject("course", course); model.addObject("course", course);

Loading…
Cancel
Save