diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/controller/CourseController.class b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/controller/CourseController.class
new file mode 100644
index 0000000..f1385a6
Binary files /dev/null and b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/controller/CourseController.class differ
diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/mapper/CourseDao.class b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/mapper/CourseDao.class
new file mode 100644
index 0000000..5266624
Binary files /dev/null and b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/mapper/CourseDao.class differ
diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/mapper/impl/CourseDaoImpl.class b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/mapper/impl/CourseDaoImpl.class
new file mode 100644
index 0000000..7239121
Binary files /dev/null and b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/mapper/impl/CourseDaoImpl.class differ
diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/pojo/Course.class b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/pojo/Course.class
new file mode 100644
index 0000000..364eed0
Binary files /dev/null and b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/pojo/Course.class differ
diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/pojo/Score.class b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/pojo/Score.class
new file mode 100644
index 0000000..490e111
Binary files /dev/null and b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/pojo/Score.class differ
diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/service/CourseService.class b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/service/CourseService.class
new file mode 100644
index 0000000..4e09fcb
Binary files /dev/null and b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/service/CourseService.class differ
diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/mapper/CourseMapper.xml b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/mapper/CourseMapper.xml
new file mode 100644
index 0000000..964bb27
--- /dev/null
+++ b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/mapper/CourseMapper.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/spring-security.xml b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/spring-security.xml
index 9447814..412183f 100644
--- a/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/spring-security.xml
+++ b/project2/out/artifacts/project2_war_exploded/WEB-INF/classes/spring-security.xml
@@ -22,6 +22,7 @@
+
+<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
+
+
+
+
+
+
+
+ 课程信息查看
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 课程ID |
+ 课程名 |
+ 课程描述 |
+
+
+
+
+
+ ${course.CourseID} |
+ ${course.CourseName} |
+ ${course.Description} |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/project2/out/artifacts/project2_war_exploded/WEB-INF/views/dashboard.jsp b/project2/out/artifacts/project2_war_exploded/WEB-INF/views/dashboard.jsp
index 8224a3f..0950b2f 100644
--- a/project2/out/artifacts/project2_war_exploded/WEB-INF/views/dashboard.jsp
+++ b/project2/out/artifacts/project2_war_exploded/WEB-INF/views/dashboard.jsp
@@ -42,20 +42,19 @@
diff --git a/project2/out/artifacts/project2_war_exploded/resources/dashboard.html b/project2/out/artifacts/project2_war_exploded/resources/dashboard.html
deleted file mode 100644
index 4555c41..0000000
--- a/project2/out/artifacts/project2_war_exploded/resources/dashboard.html
+++ /dev/null
@@ -1,136 +0,0 @@
-
-
-
-
-
-
-
- 面板
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/project2/out/artifacts/project2_war_exploded/resources/index.html b/project2/out/artifacts/project2_war_exploded/resources/index.html
deleted file mode 100644
index ebbfccd..0000000
--- a/project2/out/artifacts/project2_war_exploded/resources/index.html
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
-
- Material Design for Bootstrap
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Thank you for using our product. We're glad you're with us.
-
MDB Team
-
Start MDB tutorial
-
-
-
-
-
-
-
-
-
-
-
diff --git a/project2/out/artifacts/project2_war_exploded/resources/studentListQuery.jsp.html b/project2/out/artifacts/project2_war_exploded/resources/studentListQuery.jsp.html
deleted file mode 100644
index f84ed2a..0000000
--- a/project2/out/artifacts/project2_war_exploded/resources/studentListQuery.jsp.html
+++ /dev/null
@@ -1,237 +0,0 @@
-
-
-
-
-
-
-
- 学生信息查询
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/project2/src/main/java/cyou/chenx221/controller/CourseController.java b/project2/src/main/java/cyou/chenx221/controller/CourseController.java
new file mode 100644
index 0000000..0b25897
--- /dev/null
+++ b/project2/src/main/java/cyou/chenx221/controller/CourseController.java
@@ -0,0 +1,27 @@
+package cyou.chenx221.controller;
+
+import cyou.chenx221.pojo.Course;
+import cyou.chenx221.service.CourseService;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import java.util.List;
+
+@Controller
+@RequestMapping("/course")
+public class CourseController {
+ private final CourseService courseService;
+
+ public CourseController(CourseService courseService) {
+ this.courseService = courseService;
+ }
+
+ @GetMapping("/all")//课程信息查询(不带条件)
+ public String getAllCourses(Model model) {
+ List courses = courseService.getAllCourses();
+ model.addAttribute("courses", courses);
+ return "courseList"; // 重定向到 dashboard 页面
+ }
+}
diff --git a/project2/src/main/java/cyou/chenx221/mapper/CourseDao.java b/project2/src/main/java/cyou/chenx221/mapper/CourseDao.java
new file mode 100644
index 0000000..9281450
--- /dev/null
+++ b/project2/src/main/java/cyou/chenx221/mapper/CourseDao.java
@@ -0,0 +1,11 @@
+package cyou.chenx221.mapper;
+
+import cyou.chenx221.pojo.Course;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+public interface CourseDao {
+ List getAllCourses();
+}
diff --git a/project2/src/main/java/cyou/chenx221/mapper/impl/CourseDaoImpl.java b/project2/src/main/java/cyou/chenx221/mapper/impl/CourseDaoImpl.java
new file mode 100644
index 0000000..ad166f8
--- /dev/null
+++ b/project2/src/main/java/cyou/chenx221/mapper/impl/CourseDaoImpl.java
@@ -0,0 +1,23 @@
+package cyou.chenx221.mapper.impl;
+
+import cyou.chenx221.mapper.CourseDao;
+import cyou.chenx221.pojo.Course;
+import org.apache.ibatis.session.SqlSession;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+public class CourseDaoImpl implements CourseDao {
+ private SqlSession sqlSession;
+ @Autowired
+ public CourseDaoImpl(SqlSession sqlSession) {
+ this.sqlSession = sqlSession;
+ }
+
+ @Override
+ public List getAllCourses() {
+ return sqlSession.selectList("getAllCourses");
+ }
+}
diff --git a/project2/src/main/java/cyou/chenx221/pojo/Score.java b/project2/src/main/java/cyou/chenx221/pojo/Score.java
new file mode 100644
index 0000000..32fffe0
--- /dev/null
+++ b/project2/src/main/java/cyou/chenx221/pojo/Score.java
@@ -0,0 +1,57 @@
+package cyou.chenx221.pojo;
+
+public class Score {
+ private Integer ScoreID; //成绩记录ID
+ private Student student; //。。。
+ private Course course; //。。。
+ private Integer score; //成绩
+
+ public Score(Integer scoreID, Student student, Course course, Integer score) {
+ ScoreID = scoreID;
+ this.student = student;
+ this.course = course;
+ this.score = score;
+ }
+
+ public Integer getScoreID() {
+ return ScoreID;
+ }
+
+ public void setScoreID(Integer scoreID) {
+ ScoreID = scoreID;
+ }
+
+ public Student getStudent() {
+ return student;
+ }
+
+ public void setStudent(Student student) {
+ this.student = student;
+ }
+
+ public Course getCourse() {
+ return course;
+ }
+
+ public void setCourse(Course course) {
+ this.course = course;
+ }
+
+ public Integer getScore() {
+ return score;
+ }
+
+ public void setScore(Integer score) {
+ this.score = score;
+ }
+
+ @Override
+ public String toString() {
+ return "Score{" +
+ "ScoreID=" + ScoreID +
+ ", student=" + student +
+ ", course=" + course +
+ ", score=" + score +
+ '}';
+ }
+}
diff --git a/project2/src/main/java/cyou/chenx221/service/CourseService.java b/project2/src/main/java/cyou/chenx221/service/CourseService.java
new file mode 100644
index 0000000..2046923
--- /dev/null
+++ b/project2/src/main/java/cyou/chenx221/service/CourseService.java
@@ -0,0 +1,16 @@
+package cyou.chenx221.service;
+
+import cyou.chenx221.mapper.CourseDao;
+import cyou.chenx221.pojo.Course;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class CourseService {
+ private CourseDao courseDao;
+
+ public List getAllCourses() {
+ return courseDao.getAllCourses();
+ }
+}
diff --git a/project2/src/main/resources/mapper/CourseMapper.xml b/project2/src/main/resources/mapper/CourseMapper.xml
new file mode 100644
index 0000000..964bb27
--- /dev/null
+++ b/project2/src/main/resources/mapper/CourseMapper.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/project2/src/main/resources/mybatis-config.xml b/project2/src/main/resources/mybatis-config.xml
index b0b0060..56c0ca3 100644
--- a/project2/src/main/resources/mybatis-config.xml
+++ b/project2/src/main/resources/mybatis-config.xml
@@ -12,6 +12,7 @@
+
diff --git a/project2/src/main/resources/spring-security.xml b/project2/src/main/resources/spring-security.xml
index 9447814..412183f 100644
--- a/project2/src/main/resources/spring-security.xml
+++ b/project2/src/main/resources/spring-security.xml
@@ -22,6 +22,7 @@
+
+<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
+
+
+
+
+
+
+
+ 课程信息查看
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 课程ID |
+ 课程名 |
+ 课程描述 |
+
+
+
+
+
+ ${course.CourseID} |
+ ${course.CourseName} |
+ ${course.Description} |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/project2/web/WEB-INF/views/dashboard.jsp b/project2/web/WEB-INF/views/dashboard.jsp
index e929034..0950b2f 100644
--- a/project2/web/WEB-INF/views/dashboard.jsp
+++ b/project2/web/WEB-INF/views/dashboard.jsp
@@ -48,13 +48,13 @@
- 学生成绩管理
+ 成绩管理
学生成绩管理
学生成绩管理
- 学生选课管理
+ 课程管理
学生选课管理
学生选课管理