1. 显示我的课程模块: 使用了Spring MVC的注解@RequestMapping,通过调用CourseService的findByTeacherID方法查询指定教师的所有课程信息,并将结果存入ModelAndView中返回给前端页面展示。

  2. 展示所有课程模块: 同样使用了@RequestMapping注解,通过调用CourseService的findByPaging方法分页查询所有课程信息,并将查询结果存入PageInfo对象中,最终将PageInfo对象存入ModelAndView中返回给前端页面展示。

  3. 搜索课程模块: 先通过ajax将查询的课程名称存入session中,再通过@RequestMapping注解的方式调用CourseService的findByName方法查询指定课程名称的课程信息,同样将查询结果存入PageInfo对象中,最终将PageInfo对象存入ModelAndView中返回给前端页面展示。

  4. 选课操作模块: 通过@RequestMapping注解的方式调用SelectedCourseService的save方法保存选课信息,如果该门课程已被选,则抛出CustomException异常。

  5. 退课操作模块: 通过@RequestMapping注解的方式调用SelectedCourseService的remove方法删除选课信息。

  6. 已选课程模块: 通过调用StudentService的findStudentAndSelectCourseListByName方法查询指定学生已选的课程信息,并将结果存入Model中返回给前端页面展示。

  7. 已修课程模块: 同样通过调用StudentService的findStudentAndSelectCourseListByName方法查询指定学生已修的课程信息,并将结果存入Model中返回给前端页面展示

blic class TeacherController Resourcename = teacherServiceImpl private TeacherService teacherService; Resourcename = courseServiceImpl private CourseService courseService; Resourcename

原文地址: https://www.cveoy.top/t/topic/hjPk 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录