main
tamguo 7 years ago
parent e5f9e16752
commit b431257102

@ -36,6 +36,7 @@ public class CourseController {
@RequestMapping(value = {"course/{uid}"}, method = RequestMethod.GET)
public ModelAndView index(@PathVariable String uid , ModelAndView model) {
try {
CourseEntity course = iCourseService.find(uid);
SubjectEntity subject = iSubjectService.find(course.getSubjectId());
List<ChapterEntity> chapterList = iChapterService.findCourseChapter(uid);
@ -48,6 +49,10 @@ public class CourseController {
model.setViewName("chapter");
return model;
} catch (Exception e) {
model.setViewName("404");
return model;
}
}
@RequestMapping(value = {"course/findChapter"}, method = RequestMethod.GET)

@ -46,6 +46,7 @@ public class PaperController {
@RequestMapping(value = {"paperlist/{subjectId}-{courseId}-{paperType}-{year}-{area}-{pageNum}"}, method = RequestMethod.GET)
public ModelAndView indexAction(@PathVariable String subjectId , @PathVariable String courseId , @PathVariable String paperType,
@PathVariable String year , @PathVariable String area , @PathVariable Integer pageNum, ModelAndView model) {
try {
model.setViewName("paperlist");
CourseEntity course = iCourseService.find(courseId);
@ -68,10 +69,16 @@ public class PaperController {
model.addObject("year", year);
model.addObject("area", area);
return model;
} catch (Exception e) {
model.setViewName("404");
return model;
}
}
@RequestMapping(value = {"/paper/{paperId}.html"}, method = RequestMethod.GET)
public ModelAndView indexAction(@PathVariable String paperId , ModelAndView model){
try {
model.setViewName("paper");
PaperEntity paper = iPaperService.find(paperId);
model.addObject("paper", paper);
@ -85,6 +92,11 @@ public class PaperController {
model.addObject("yatiPaperList", iPaperService.featuredPaper(TamguoConstant.YATI_PAPER_ID, paper.getSubjectId()));
model.addObject("hotPaperList", iPaperService.findHotPaper(paper.getSubjectId(), paper.getCourseId()));
return model;
} catch (Exception e) {
model.setViewName("404");
return model;
}
}
@RequestMapping(value = {"/paper/area/{areaId}-{type}.html"}, method = RequestMethod.GET)

@ -35,6 +35,7 @@ public class QuestionContrller {
@RequestMapping(value = {"questionlist/{chapterId}-{offset}-{limit}"}, method = RequestMethod.GET)
public ModelAndView questionList(@PathVariable String chapterId , @PathVariable Integer offset ,
@PathVariable Integer limit , ModelAndView model){
try {
model.setViewName("questionList");
ChapterEntity chapter = iChapterService.findById(chapterId);
@ -56,6 +57,11 @@ public class QuestionContrller {
model.addObject("subjectId", course.getSubjectId());
model.addObject("courseId", course.getUid());
return model;
} catch (Exception e) {
model.setViewName("404");
return model;
}
}
/**
@ -66,6 +72,7 @@ public class QuestionContrller {
*/
@RequestMapping(value = {"/question/{uid}.html"}, method = RequestMethod.GET)
public ModelAndView question(@PathVariable String uid , ModelAndView model){
try {
model.setViewName("question");
QuestionEntity question = iQuestionService.findNormalQuestion(uid);
question.setQuestionType(QuestionType.getQuestionType(question.getQuestionType()).getDesc());
@ -74,9 +81,14 @@ public class QuestionContrller {
// 推荐试题
model.addObject("featuredQuestionList", iQuestionService.featuredQuestion(question.getSubjectId(),question.getCourseId()));
return model;
} catch (Exception e) {
model.setViewName("404");
return model;
}
}
@RequestMapping(value = {"/question/getQuestion/{uid}.html"}, method = RequestMethod.GET)
@RequestMapping(value = {"question/getQuestion/{uid}"}, method = RequestMethod.GET)
@ResponseBody
public Result getQuestion(@PathVariable String uid , ModelAndView model){
return Result.successResult(iQuestionService.select(uid));

@ -24,7 +24,7 @@ public class SchoolController {
@Autowired
private ISchoolService iSchoolService;
@RequestMapping(value = {"/school/area/{areaId}.html"}, method = RequestMethod.GET)
@RequestMapping(value = {"school/area/{areaId}"}, method = RequestMethod.GET)
@ResponseBody
public List<SchoolEntity> findSchoolByAreaId(@PathVariable String areaId , ModelAndView model){
return iSchoolService.findEliteSchoolPaper(areaId);
@ -35,7 +35,7 @@ public class SchoolController {
* @param areaId
* @return
*/
@RequestMapping(value = {"/school/findByAreaId.html"}, method = RequestMethod.GET)
@RequestMapping(value = {"school/findByAreaId"}, method = RequestMethod.GET)
@ResponseBody
public List<SchoolEntity> findSchoolByAreaId(String areaId){
return iSchoolService.findSchoolByAreaId(areaId);

@ -36,6 +36,7 @@ public class SubjectController {
@RequestMapping(value = {"subject/{subjectId}.html"}, method = RequestMethod.GET)
public ModelAndView indexAction(@PathVariable String subjectId , ModelAndView model) {
try {
SubjectEntity subject = iSubjectService.find(subjectId);
// 获取第一个科目
CourseEntity course = subject.getCourseList().get(0);
@ -47,6 +48,11 @@ public class SubjectController {
model.addObject("chapterList" , chapterList);
model.addObject("areaList", iAreaService.findRootArea());
return model;
} catch (Exception e) {
model.setViewName("404");
return model;
}
}
@RequestMapping(value = {"subject/getCourseTree.html"}, method = RequestMethod.GET)

Loading…
Cancel
Save