首页>代码>ssm开发学校教务查询系统(高端毕业设计)>/Examination_System/src/main/java/com/system/controller/TeacherController.java
package com.system.controller; import com.system.exception.CustomException; import com.system.po.*; import com.system.service.CourseService; import com.system.service.SelectedCourseService; import com.system.service.StudentService; import com.system.service.TeacherService; import org.apache.shiro.SecurityUtils; import org.apache.shiro.subject.Subject; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import javax.annotation.Resource; import java.util.List; /** * Created by Jacey on 2017/7/6. */ @Controller @RequestMapping(value = "/teacher") public class TeacherController { @Resource(name = "teacherServiceImpl") private TeacherService teacherService; @Resource(name = "courseServiceImpl") private CourseService courseService; @Resource(name = "selectedCourseServiceImpl") private SelectedCourseService selectedCourseService; // 显示我的课程 @RequestMapping(value = "/showCourse") public String stuCourseShow(Model model) throws Exception { Subject subject = SecurityUtils.getSubject(); String username = (String) subject.getPrincipal(); List<CourseCustom> list = courseService.findByTeacherID(Integer.parseInt(username)); model.addAttribute("courseList", list); return "teacher/showCourse"; } // 显示成绩 @RequestMapping(value = "/gradeCourse") public String gradeCourse(Integer id, Model model) throws Exception { if (id == null) { return ""; } List<SelectedCourseCustom> list = selectedCourseService.findByCourseID(id); model.addAttribute("selectedCourseList", list); return "teacher/showGrade"; } // 打分 @RequestMapping(value = "/mark", method = {RequestMethod.GET}) public String markUI(SelectedCourseCustom scc, Model model) throws Exception { SelectedCourseCustom selectedCourseCustom = selectedCourseService.findOne(scc); model.addAttribute("selectedCourse", selectedCourseCustom); return "teacher/mark"; } // 打分 @RequestMapping(value = "/mark", method = {RequestMethod.POST}) public String mark(SelectedCourseCustom scc) throws Exception { selectedCourseService.updataOne(scc); return "redirect:/teacher/gradeCourse?id="+scc.getCourseid(); } //修改密码 @RequestMapping(value = "/passwordRest") public String passwordRest() throws Exception { return "teacher/passwordRest"; } }
最近下载更多
森sdfgf LV8
2月4日
t_suerinfo LV1
2023年8月28日
donnyine LV3
2023年6月19日
qiangmin1223 LV11
2023年4月24日
ed8vid LV4
2023年3月21日
zdhsqnm LV1
2023年2月10日
LITIANYU084414 LV11
2023年1月4日
微信网友_6248713511227392 LV11
2022年12月5日
jiangchen666888 LV1
2022年11月30日
1792461859 LV2
2022年11月15日