From 191c4f3d9131a8775afbcb7c160c487075193f6c Mon Sep 17 00:00:00 2001 From: Chenx221 Date: Fri, 9 Jun 2023 20:55:13 +0800 Subject: [PATCH] submit Signed-off-by: Chenx221 --- .../controller/CourseController.class | Bin 0 -> 1276 bytes .../cyou/chenx221/mapper/CourseDao.class | Bin 0 -> 321 bytes .../chenx221/mapper/impl/CourseDaoImpl.class | Bin 0 -> 932 bytes .../classes/cyou/chenx221/pojo/Course.class | Bin 0 -> 1823 bytes .../classes/cyou/chenx221/pojo/Score.class | Bin 0 -> 2166 bytes .../cyou/chenx221/service/CourseService.class | Bin 0 -> 675 bytes .../WEB-INF/classes/mapper/CourseMapper.xml | 11 + .../WEB-INF/classes/spring-security.xml | 1 + .../WEB-INF/views/courseList.jsp | 172 +++++++++++++ .../WEB-INF/views/dashboard.jsp | 9 +- .../resources/dashboard.html | 136 ---------- .../resources/index.html | 52 ---- .../resources/studentListQuery.jsp.html | 237 ------------------ .../chenx221/controller/CourseController.java | 27 ++ .../java/cyou/chenx221/mapper/CourseDao.java | 11 + .../chenx221/mapper/impl/CourseDaoImpl.java | 23 ++ .../main/java/cyou/chenx221/pojo/Score.java | 57 +++++ .../cyou/chenx221/service/CourseService.java | 16 ++ .../main/resources/mapper/CourseMapper.xml | 11 + .../src/main/resources/mybatis-config.xml | 1 + .../src/main/resources/spring-security.xml | 1 + project2/web/WEB-INF/views/courseList.jsp | 172 +++++++++++++ project2/web/WEB-INF/views/dashboard.jsp | 4 +- 23 files changed, 509 insertions(+), 432 deletions(-) create mode 100644 project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/controller/CourseController.class create mode 100644 project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/mapper/CourseDao.class create mode 100644 project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/mapper/impl/CourseDaoImpl.class create mode 100644 project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/pojo/Course.class create mode 100644 project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/pojo/Score.class create mode 100644 project2/out/artifacts/project2_war_exploded/WEB-INF/classes/cyou/chenx221/service/CourseService.class create mode 100644 project2/out/artifacts/project2_war_exploded/WEB-INF/classes/mapper/CourseMapper.xml create mode 100644 project2/out/artifacts/project2_war_exploded/WEB-INF/views/courseList.jsp delete mode 100644 project2/out/artifacts/project2_war_exploded/resources/dashboard.html delete mode 100644 project2/out/artifacts/project2_war_exploded/resources/index.html delete mode 100644 project2/out/artifacts/project2_war_exploded/resources/studentListQuery.jsp.html create mode 100644 project2/src/main/java/cyou/chenx221/controller/CourseController.java create mode 100644 project2/src/main/java/cyou/chenx221/mapper/CourseDao.java create mode 100644 project2/src/main/java/cyou/chenx221/mapper/impl/CourseDaoImpl.java create mode 100644 project2/src/main/java/cyou/chenx221/pojo/Score.java create mode 100644 project2/src/main/java/cyou/chenx221/service/CourseService.java create mode 100644 project2/src/main/resources/mapper/CourseMapper.xml create mode 100644 project2/web/WEB-INF/views/courseList.jsp 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 0000000000000000000000000000000000000000..f1385a68283b9b3cb8c65ca2d34e3e90dc53220e GIT binary patch literal 1276 zcma)5T~8B16g|@x7RvHfC?AT5BD!sXk;Vs;A_>9ZOREW(`ry-aJC?!iZrz;)`B$3w z5qcT0h$X?WPl-ZS@}IdkUTzyE&!0q_FlEK*1t$e0+xD8tODI1}6vZi~NZ zoJw0WjP5E|={<(DRj7|+4C4l}CMIAq6zmHxi8$4N8<3^}V%jV~5z z+kw|-2;Y^c4FA-@LKA+{?}nx zxGDXjb18qTFL$@^9v$!0>-JD(kCZPTg|1d@SyzD~6ZT!#(?ToHB@dnr6m~8fyrJAC z7rk8mO6r>EbfUMVdz}dV`^+$9;(RleA0ARjlUf=US#*6_Ybu6rKjn3 zB>8f7=!EA3vj+(~lAl5uToY%|6h@vVc9Tjf0kdCgsjbfdVyroeuqo|Ux9X?eG7 zs7?YCO=)KBH!lht9G_HcR+o&Gm5Heo7%hx;Ds_PbXosIvX4p?Yp60jiN+@5(Ye&0_V=Ihkw_Amay3d~eq^%L%2&d? zCXbQ!99 zRffi8aPsCdCM}_|q^Hpg|B39nROvy`nuao`VxDIOKDHTlm#Ui!V`w!mC#2P5C?1(p z$xsWGmT$6AU#9OwKc+}MG?9pVB2~FR3l`nEveY14N?~!p0mIHorkxtep0bL7I$9e? zlQo)fUQBq}Bo}*@ijll9>3iOnLR)?&B4^Su7xMz%$(*@RsXQgvdUIho4CSsGXyLMy z`16H?ga243W@u*n5F8R@rAxaJ$zwHTTc@~6#k|y-QEl3W(+7k z{n05m1VeP)v`n$d5H1uC+wB1F3&*sMD-tS`LRR7=x43IKWwhUc-FvSV2T%lXSWq4Z%2=$pfKE0M=uZdy7kJdl*kRejFYgBr6 z*R=Rv^ZbZA2l`RHC5CP2^+Vk;<=!(!#ED5{CwBWvS|Lr1mbgmOWUV6_NqEdfN3GF< zpZtwp&Pu+PXKaj11q;tKeXp1kuwD6Yc?4u@RlJa zY~@eo?o+u2-!`RcNmbplJV73k1T%D1Lv#njG}3*gRY<-It(opM&2cb#Snkl6r`<>S*wCCU z{Q@g3UO_7@T_OFW6>yiv93nKvXpGY@fegV-kY!qh;T|SwM*x^2c-C6or&XwxChDbG zqgnnpAk%cfZw2|UvRRR9AXD5E4Z9zeMb@DqdIDJTTVPT~VYfx!>(&#m6ph$NJ literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..490e111e1061793d1409976db9e510ff53357230 GIT binary patch literal 2166 zcmcJQ-EPxJ6vzLQCUF}QN?H;~peY{(lF&9wVPPS(d;}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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 @@
  • -
  • 学生成绩管理
  • +
  • 成绩管理
  • 学生成绩管理
  • 学生成绩管理
  • -
  • 学生选课管理
  • +
  • 课程管理
  • 学生选课管理
  • 学生选课管理