From 63b67ae57ffc97af5847f3c41edd8b931c2ed85d Mon Sep 17 00:00:00 2001 From: awinx Date: Sat, 7 Dec 2024 19:53:28 +0800 Subject: [PATCH] learn02 --- .idea/artifacts/learn02_war_exploded.xml | 9 +- .idea/artifacts/learn02_war_exploded2.xml | 20 -- .idea/compiler.xml | 8 + .idea/encodings.xml | 4 + .idea/inspectionProfiles/Project_Default.xml | 10 + .idea/jarRepositories.xml | 20 ++ .idea/misc.xml | 14 + learn02/learn02.iml | 7 + learn02/src/common/DBTool.java | 84 ++++++ learn02/src/controller/BaseController.java | 25 ++ learn02/src/controller/CourseController.java | 106 +++++++ learn02/src/controller/ScoreController.java | 13 + learn02/src/controller/StudentController.java | 22 ++ learn02/src/controller/TeacherController.java | 12 + learn02/src/controller/UserController.java | 43 +++ learn02/src/dao/CourseDB.java | 65 +++++ learn02/src/dao/ScoreDB.java | 15 + learn02/src/dao/StudentDB.java | 15 + learn02/src/dao/TeacherDB.java | 14 + learn02/src/dao/UserDB.java | 11 + learn02/src/dao/impl/CourseDBImpl.java | 177 ++++++++++++ learn02/src/dao/impl/TeacherDBImpl.java | 60 ++++ learn02/src/dao/impl/UserDBImpl.java | 103 +++++++ learn02/src/database.properties | 41 +++ learn02/src/filters/GlobalFilter.java | 17 ++ learn02/src/pojo/CourseInfo.java | 33 +++ learn02/src/pojo/ScoreInfo.java | 25 ++ learn02/src/pojo/StudentInfo.java | 32 +++ learn02/src/pojo/TeacherInfo.java | 30 ++ learn02/src/pojo/UserInfo.java | 25 ++ learn02/src/service/CourseService.java | 4 + learn02/src/service/UserService.java | 4 + learn02/src/test/TestDao.java | 15 + learn02/web/course/course.jsp | 63 +++++ learn02/web/course/course_edit.jsp | 87 ++++++ learn02/web/course/tmp | 82 ++++++ learn02/web/css/common.css | 62 +++++ learn02/web/css/course.css | 8 + learn02/web/css/index.css | 41 +++ learn02/web/css/login.css | 15 + learn02/web/error.jsp | 16 ++ learn02/web/home.jsp | 44 +++ learn02/web/index.jsp | 19 +- learn02/web/js/course-edit.js | 145 ++++++++++ learn02/web/js/index.js | 0 learn02/web/js/jquery-3.7.1.min.js | 2 + learn02/web/js/vue.min.js | 11 + learn02/web/login/login.jsp | 41 +++ learn03-springboot/.gitattributes | 2 + learn03-springboot/.gitignore | 33 +++ .../.mvn/wrapper/maven-wrapper.properties | 19 ++ learn03-springboot/mvnw | 259 ++++++++++++++++++ learn03-springboot/mvnw.cmd | 149 ++++++++++ learn03-springboot/pom.xml | 85 ++++++ .../learn/Learn03SpringbootApplication.java | 13 + .../top/awin_x/learn/ServletInitializer.java | 13 + .../src/main/resources/application.properties | 1 + .../Learn03SpringbootApplicationTests.java | 13 + learn1/src/course/CourseDB.java | 2 +- 59 files changed, 2281 insertions(+), 27 deletions(-) delete mode 100644 .idea/artifacts/learn02_war_exploded2.xml create mode 100644 .idea/jarRepositories.xml create mode 100644 learn02/src/common/DBTool.java create mode 100644 learn02/src/controller/BaseController.java create mode 100644 learn02/src/controller/CourseController.java create mode 100644 learn02/src/controller/ScoreController.java create mode 100644 learn02/src/controller/StudentController.java create mode 100644 learn02/src/controller/TeacherController.java create mode 100644 learn02/src/controller/UserController.java create mode 100644 learn02/src/dao/CourseDB.java create mode 100644 learn02/src/dao/ScoreDB.java create mode 100644 learn02/src/dao/StudentDB.java create mode 100644 learn02/src/dao/TeacherDB.java create mode 100644 learn02/src/dao/UserDB.java create mode 100644 learn02/src/dao/impl/CourseDBImpl.java create mode 100644 learn02/src/dao/impl/TeacherDBImpl.java create mode 100644 learn02/src/dao/impl/UserDBImpl.java create mode 100644 learn02/src/database.properties create mode 100644 learn02/src/filters/GlobalFilter.java create mode 100644 learn02/src/pojo/CourseInfo.java create mode 100644 learn02/src/pojo/ScoreInfo.java create mode 100644 learn02/src/pojo/StudentInfo.java create mode 100644 learn02/src/pojo/TeacherInfo.java create mode 100644 learn02/src/pojo/UserInfo.java create mode 100644 learn02/src/service/CourseService.java create mode 100644 learn02/src/service/UserService.java create mode 100644 learn02/src/test/TestDao.java create mode 100644 learn02/web/course/course.jsp create mode 100644 learn02/web/course/course_edit.jsp create mode 100644 learn02/web/course/tmp create mode 100644 learn02/web/css/common.css create mode 100644 learn02/web/css/course.css create mode 100644 learn02/web/css/index.css create mode 100644 learn02/web/css/login.css create mode 100644 learn02/web/error.jsp create mode 100644 learn02/web/home.jsp create mode 100644 learn02/web/js/course-edit.js create mode 100644 learn02/web/js/index.js create mode 100644 learn02/web/js/jquery-3.7.1.min.js create mode 100644 learn02/web/js/vue.min.js create mode 100644 learn02/web/login/login.jsp create mode 100644 learn03-springboot/.gitattributes create mode 100644 learn03-springboot/.gitignore create mode 100644 learn03-springboot/.mvn/wrapper/maven-wrapper.properties create mode 100644 learn03-springboot/mvnw create mode 100644 learn03-springboot/mvnw.cmd create mode 100644 learn03-springboot/pom.xml create mode 100644 learn03-springboot/src/main/java/top/awin_x/learn/Learn03SpringbootApplication.java create mode 100644 learn03-springboot/src/main/java/top/awin_x/learn/ServletInitializer.java create mode 100644 learn03-springboot/src/main/resources/application.properties create mode 100644 learn03-springboot/src/test/java/top/awin_x/learn/Learn03SpringbootApplicationTests.java diff --git a/.idea/artifacts/learn02_war_exploded.xml b/.idea/artifacts/learn02_war_exploded.xml index e86e692..4da71e5 100644 --- a/.idea/artifacts/learn02_war_exploded.xml +++ b/.idea/artifacts/learn02_war_exploded.xml @@ -2,12 +2,19 @@ $PROJECT_DIR$/out/artifacts/learn02_war_exploded - + + + + + + + + \ No newline at end of file diff --git a/.idea/artifacts/learn02_war_exploded2.xml b/.idea/artifacts/learn02_war_exploded2.xml deleted file mode 100644 index dce5a39..0000000 --- a/.idea/artifacts/learn02_war_exploded2.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - $PROJECT_DIR$/out/artifacts/learn02_war_exploded2 - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml index a1757ae..cfa0a0e 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -3,6 +3,14 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml index c9fda07..e0f8c39 100644 --- a/.idea/encodings.xml +++ b/.idea/encodings.xml @@ -2,6 +2,10 @@ + + + + diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml index 04ca9a9..4f05eb4 100644 --- a/.idea/inspectionProfiles/Project_Default.xml +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -4,6 +4,16 @@ + + + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 0000000..5a2f139 --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 8780e86..7fe267b 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,5 +1,19 @@ + + + + + diff --git a/learn02/learn02.iml b/learn02/learn02.iml index abfa2d4..7fdfd07 100644 --- a/learn02/learn02.iml +++ b/learn02/learn02.iml @@ -19,5 +19,12 @@ + + + + + + + \ No newline at end of file diff --git a/learn02/src/common/DBTool.java b/learn02/src/common/DBTool.java new file mode 100644 index 0000000..e421cfd --- /dev/null +++ b/learn02/src/common/DBTool.java @@ -0,0 +1,84 @@ +package common; + +import org.apache.commons.dbcp2.BasicDataSourceFactory; + +import javax.sql.DataSource; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.Properties; + + +/** + * 这是一个数据库工具类,创建了一个数据库连接池 + * 需要在database.properties中配置数据库连接属性 + * @author Awin-x + */ +public class DBTool { + static DataSource ds; + static{ + Properties prop = new Properties(); + try { + InputStream database_info = DBTool.class.getClassLoader().getResourceAsStream("database.properties"); + if (database_info != null) { + prop.load(new InputStreamReader(database_info, "GBK")); + prop.list(System.out); + }else{ + throw new FileNotFoundException("database.properties file does not exist in the classpath"); + } + } catch (IOException e) { + System.out.println("数据库配置加载失败!"); + throw new RuntimeException(e); + } + try { + ds = BasicDataSourceFactory.createDataSource(prop); + } catch (Exception e) { + System.out.println("数据库连接池初始化失败"); + throw new RuntimeException(e); + } + } + + public static Connection getConnection(){ + try{ + return ds.getConnection(); + } catch (SQLException e) { + e.printStackTrace(); + return null; + } + } + + public static PreparedStatement getPreparedStatement(String sql) throws SQLException{ + //noinspection SqlSourceToSinkFlow + return ds.getConnection().prepareStatement(sql); + } + + public static void close(Connection conn, PreparedStatement ps, ResultSet rs){ + try{ + if(rs != null){ + rs.close(); + } + if(ps != null){ + ps.close(); + } + if(conn != null){ + conn.close(); + } + } catch (SQLException e) { + System.out.println("关闭失败"); + e.printStackTrace(); + } + } + + public static void close(PreparedStatement ps, ResultSet rs) throws SQLException { + close(ps.getConnection(), ps, rs); + } + + public static void close(PreparedStatement ps) throws SQLException { + close(ps.getConnection(), ps, null); + } +} diff --git a/learn02/src/controller/BaseController.java b/learn02/src/controller/BaseController.java new file mode 100644 index 0000000..f7404b2 --- /dev/null +++ b/learn02/src/controller/BaseController.java @@ -0,0 +1,25 @@ +package controller; + +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + +public class BaseController extends HttpServlet { + protected void service(HttpServletRequest req, HttpServletResponse resp){ + resp.addHeader( "Access-Control-Allow-Origin","*"); + String uri = req.getRequestURI(); + + uri = uri.substring(uri.lastIndexOf("/")+1); + //使用反射获取方法来执行 + try { + Method method = this.getClass().getDeclaredMethod(uri, HttpServletRequest.class, HttpServletResponse.class); + method.setAccessible(true); + method.invoke(this, req, resp); + } catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException e) { + throw new RuntimeException(e); + } + } +} diff --git a/learn02/src/controller/CourseController.java b/learn02/src/controller/CourseController.java new file mode 100644 index 0000000..eb72308 --- /dev/null +++ b/learn02/src/controller/CourseController.java @@ -0,0 +1,106 @@ +package controller; + +import dao.impl.CourseDBImpl; +import jakarta.servlet.annotation.WebServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import pojo.CourseInfo; + +import java.io.IOException; +import java.io.PrintWriter; +import java.util.ArrayList; + +@WebServlet("/courseAction/*") +public class CourseController extends BaseController { + private void list(HttpServletRequest req, HttpServletResponse resp) throws IOException { + resp.setContentType("application/json;charset=UTF-8"); + PrintWriter out = resp.getWriter(); + int page = req.getParameter("page") == null ? 1 : Integer.parseInt(req.getParameter("page")); + int pageSize = req.getParameter("pageSize") == null ? 10 : Integer.parseInt(req.getParameter("pageSize")); + String keyword = req.getParameter("keyword"); + int courseType = req.getParameter("courseType").isEmpty() ? 0 : Integer.parseInt(req.getParameter("courseType")); + ArrayList course_list = new CourseDBImpl().getCourseInfos(page, pageSize, keyword, courseType); + StringBuilder data = new StringBuilder(); + for (CourseInfo course : course_list) { + data.append(course.toJSON()).append(","); + } + if (!data.isEmpty()) { + data.setLength(data.length() - 1); + } + String json = "{\"total\":" + new CourseDBImpl().getAllCourseInfoCount(keyword, courseType) + + ",\"data\":[" + + data + + "],\"page\":" + + page + + ",\"pageSize\":" + + pageSize + + ",\"success\":true}"; + out.print(json); + } + + private void update(HttpServletRequest req, HttpServletResponse resp) throws IOException { + resp.setContentType("application/json;charset=UTF-8"); + PrintWriter out = resp.getWriter(); + if (req.getParameter("id") == null) { + out.println("{\"success\":false}\"}"); + return; + } + int id = Integer.parseInt(req.getParameter("id")); + CourseInfo course = new CourseDBImpl().getCourseInfoByID(id); + if (course == null) { + out.println("{\"success\":false}\"}"); + return; + } + String name = req.getParameter("name"); + int type = Integer.parseInt(req.getParameter("type")); + float credit = Float.parseFloat(req.getParameter("credit")); + int grade = Integer.parseInt(req.getParameter("grade")); + int major = Integer.parseInt(req.getParameter("major")); + String detail = req.getParameter("detail"); + course.setName(name); + course.setType(type); + course.setCredit(credit); + course.setGrade(grade); + course.setMajor(major); + course.setDetail(detail); + + if (new CourseDBImpl().updateCourseInfo(course) >= 1) { + out.println("{\"success\":true}"); + } else { + out.println("{\"success\":false}"); + } + } + + private void delete(HttpServletRequest req, HttpServletResponse resp) throws IOException { + int id = Integer.parseInt(req.getParameter("id")); + resp.setContentType("application/json;charset=UTF-8"); + PrintWriter out = resp.getWriter(); + if (new CourseDBImpl().deleteCourseInfo(id) >= 1) { + out.print("{\"success\": true}"); + } else { + out.print("{\"success\": false}"); + } + } + + private void add(HttpServletRequest req, HttpServletResponse resp) throws IOException { + resp.setContentType("application/json;charset=UTF-8"); + PrintWriter out = resp.getWriter(); + if (req.getParameter("id") == null) { + out.println("{\"success\":false}\"}"); + return; + } + int id = Integer.parseInt(req.getParameter("id")); + CourseInfo course = new CourseInfo(); + course.setName(req.getParameter("name")); + course.setType(Integer.parseInt(req.getParameter("type"))); + course.setCredit(Float.parseFloat(req.getParameter("credit"))); + course.setGrade(Integer.parseInt(req.getParameter("grade"))); + course.setMajor(Integer.parseInt(req.getParameter("major"))); + course.setDetail(req.getParameter("detail")); + if (new CourseDBImpl().addCourseInfo(course) >= 1) { + out.println("{\"success\": true}"); + }else{ + out.println("{\"success\": false}"); + } + } +} diff --git a/learn02/src/controller/ScoreController.java b/learn02/src/controller/ScoreController.java new file mode 100644 index 0000000..9162d08 --- /dev/null +++ b/learn02/src/controller/ScoreController.java @@ -0,0 +1,13 @@ +package controller; + +import jakarta.servlet.ServletException; +import jakarta.servlet.annotation.WebServlet; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + +import java.io.IOException; + +@WebServlet("/scoreAction/*") +public class ScoreController extends BaseController { +} diff --git a/learn02/src/controller/StudentController.java b/learn02/src/controller/StudentController.java new file mode 100644 index 0000000..04cea42 --- /dev/null +++ b/learn02/src/controller/StudentController.java @@ -0,0 +1,22 @@ +package controller; + +import dao.TeacherDB; +import jakarta.servlet.annotation.WebServlet; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import pojo.TeacherInfo; + +import java.util.ArrayList; + +@WebServlet("/studentAction/*") +public class StudentController extends BaseController { + private void list(HttpServletRequest req, HttpServletResponse resp) { + String path = req.getContextPath(); + if (req.getSession().getAttribute("user") == null){ + resp.setStatus(403); + return; + } + ArrayList teachers; + } +} diff --git a/learn02/src/controller/TeacherController.java b/learn02/src/controller/TeacherController.java new file mode 100644 index 0000000..146eaf5 --- /dev/null +++ b/learn02/src/controller/TeacherController.java @@ -0,0 +1,12 @@ +package controller; + +import jakarta.servlet.annotation.WebServlet; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + +import java.lang.reflect.InvocationTargetException; + +@WebServlet("/teacherAction/*") +public class TeacherController extends BaseController { +} diff --git a/learn02/src/controller/UserController.java b/learn02/src/controller/UserController.java new file mode 100644 index 0000000..9993765 --- /dev/null +++ b/learn02/src/controller/UserController.java @@ -0,0 +1,43 @@ +package controller; + +import dao.impl.UserDBImpl; +import jakarta.servlet.annotation.WebServlet; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import pojo.UserInfo; + +import java.io.IOException; +import java.lang.reflect.InvocationTargetException; + +@WebServlet("/userAction/*") +public class UserController extends BaseController { + protected void login(HttpServletRequest req, HttpServletResponse resp) throws IOException { + System.out.println("登录"); + String path = req.getContextPath(); + if (req.getSession().getAttribute("user") != null){ + resp.sendRedirect(path+"/home.jsp"); + } + String username = req.getParameter("username"); + String password = req.getParameter("password"); + UserInfo user = new UserDBImpl().getUserByName(username); + if(user == null) { + resp.sendRedirect(path+"/login/login.jsp&loginflag=1"); + }else if (user.getPass().equals(password)) { + req.getSession().setAttribute("user", user); + resp.sendRedirect(path+"/home.jsp"); + }else{ + resp.sendRedirect(path+"/login/login.jsp&loginflag=2"); + } + } + protected void logout(HttpServletRequest req, HttpServletResponse resp) throws IOException { + System.out.println("注销"); + String username = req.getParameter("username"); + UserInfo user = (UserInfo)req.getSession().getAttribute("user"); + if(user != null) { + req.getSession().removeAttribute("user"); + } + String path = req.getContextPath(); + resp.sendRedirect(path+"/login/login.jsp"); + } +} diff --git a/learn02/src/dao/CourseDB.java b/learn02/src/dao/CourseDB.java new file mode 100644 index 0000000..8156c12 --- /dev/null +++ b/learn02/src/dao/CourseDB.java @@ -0,0 +1,65 @@ +package dao; + +import pojo.CourseInfo; + +import java.util.ArrayList; + +public interface CourseDB { + /** + * 用于列出全部课程 + * @return 返回从数据库中查询到的全部课程 + */ + ArrayList getAllCourseInfo(); + + /** + * 用于分页列出筛选课程 + * @param page 页码 + * @param pageSize 每页条数 + * @param keyword 关键词筛选,为空字符串表示不筛选 + * @param type 类型筛选,为0表示不筛选 + * @return 返回从数据库查询到的该页课程 + */ + ArrayList getCourseInfos(int page, int pageSize, String keyword, int type); + + /** + * 用于获取一个课程 + * @param id 目标课程的id + * @return 根据id从数据库查询到的课程信息 + */ + CourseInfo getCourseInfoByID(int id); + + /** + * 用于获取课程总数 + * @return 返回数据库中课程信息条数 + */ + int getAllCourseInfoCount(); + + /** + * 获取一个课程筛选结果集的总数 + * @param keyword 关键词筛选,为空字符串表示不筛选 + * @param type 类型筛选,为0表示不筛选 + * @return 课程筛选结果集的总数 + */ + int getAllCourseInfoCount(String keyword, int type); + + /** + * 用于添加课程 + * @param courseInfo 要添加的课程 + * @return 影响数据库行数,行数大于0则说明添加成功 + */ + int addCourseInfo(CourseInfo courseInfo); + + /** + * 用于更新一个课程信息 + * @param courseInfo 修改的课程信息,id不可修改,id作为修改目标查找参数 + * @return 影响的行数,行数大于0则说明更新成功 + */ + int updateCourseInfo(CourseInfo courseInfo); + + /** + * 用于删除一个课程 + * @param id 要删除的课程的id + * @return 影响的行数,行数大于0则说明更新成功 + */ + int deleteCourseInfo(int id); +} diff --git a/learn02/src/dao/ScoreDB.java b/learn02/src/dao/ScoreDB.java new file mode 100644 index 0000000..c0ef1f1 --- /dev/null +++ b/learn02/src/dao/ScoreDB.java @@ -0,0 +1,15 @@ +package dao; + +import pojo.ScoreInfo; + +import java.util.ArrayList; + +public interface ScoreDB { + ScoreInfo getScoreInfoByID(int studentID, int courseID); + ArrayList getScoreInfoByStudentID(int studentID); + ArrayList getScoreInfoByCourseID(int courseID); + int getScoreByStudentID(int studentID); + int addScoreInfo(ScoreInfo scoreInfo); + int updateScoreInfo(ScoreInfo scoreInfo); + int deleteScoreInfo(int studentID, int courseID); +} diff --git a/learn02/src/dao/StudentDB.java b/learn02/src/dao/StudentDB.java new file mode 100644 index 0000000..fb3713d --- /dev/null +++ b/learn02/src/dao/StudentDB.java @@ -0,0 +1,15 @@ +package dao; + +import pojo.StudentInfo; + +import java.util.ArrayList; + +public interface StudentDB { + ArrayList getAllStudentInfo(); + StudentInfo getStudentInfoByID(int id); + StudentInfo getStudentInfoByName(String name); + StudentInfo getStudentInfoByCode(String code); + int addStudentInfo(StudentInfo studentInfo); + int updateStudentInfo(StudentInfo studentInfo); + int deleteStudentInfo(int id); +} diff --git a/learn02/src/dao/TeacherDB.java b/learn02/src/dao/TeacherDB.java new file mode 100644 index 0000000..da99744 --- /dev/null +++ b/learn02/src/dao/TeacherDB.java @@ -0,0 +1,14 @@ +package dao; + +import pojo.TeacherInfo; + +import java.util.ArrayList; + +public interface TeacherDB { + ArrayList getAllTeacherInfo(); + TeacherInfo getTeacherInfoByID(int id); + TeacherInfo getTeacherInfoByName(String name); + int addTeacherInfo(TeacherInfo teacherInfo); + int updateTeacherInfo(TeacherInfo teacherInfo); + int deleteTeacherInfo(int id); +} diff --git a/learn02/src/dao/UserDB.java b/learn02/src/dao/UserDB.java new file mode 100644 index 0000000..456409e --- /dev/null +++ b/learn02/src/dao/UserDB.java @@ -0,0 +1,11 @@ +package dao; + +import pojo.UserInfo; + +public interface UserDB { + UserInfo getUserByName(String username); + UserInfo getUserById(int id); + int addUser(UserInfo user); + int updateUser(UserInfo user); + int deleteUser(int id); +} diff --git a/learn02/src/dao/impl/CourseDBImpl.java b/learn02/src/dao/impl/CourseDBImpl.java new file mode 100644 index 0000000..8096ed4 --- /dev/null +++ b/learn02/src/dao/impl/CourseDBImpl.java @@ -0,0 +1,177 @@ +package dao.impl; + +import common.DBTool; +import dao.CourseDB; +import pojo.CourseInfo; + +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; + +public class CourseDBImpl implements CourseDB { + + private CourseInfo fillCourseInfo(ResultSet rs) throws SQLException { + CourseInfo courseInfo = new CourseInfo(); + courseInfo.setId(rs.getInt("N_COURSE_ID")); + courseInfo.setName(rs.getString("VC_COURSE_NAME")); + courseInfo.setType(rs.getInt("N_TYPE")); + courseInfo.setCredit(rs.getFloat("F_CREDIT")); + courseInfo.setGrade(rs.getInt("N_GRADE")); + courseInfo.setMajor(rs.getInt("N_MAJOR")); + courseInfo.setDetail(rs.getString("VC_DETAIL")); + return courseInfo; + } + + @Override + public ArrayList getAllCourseInfo() { + ArrayList courseList = new ArrayList<>(); + try { + PreparedStatement ps = DBTool.getPreparedStatement("SELECT * FROM t_course"); + ResultSet rs = ps.executeQuery(); + while (rs.next()) { + courseList.add(fillCourseInfo(rs)); + } + DBTool.close(ps, rs); + } catch (SQLException e) { + throw new RuntimeException(e); + } + return courseList; + } + + @Override + public ArrayList getCourseInfos(int page, int pageSize, String keyword, int type) { + ArrayList courseList = new ArrayList<>(); + String sql = "SELECT * FROM t_course WHERE UPPER(VC_COURSE_NAME) LIKE ? AND ? IN (N_TYPE, 0) ORDER BY N_COURSE_ID LIMIT ?, ?"; + try { + PreparedStatement ps = DBTool.getPreparedStatement(sql); + ps.setString(1, "%"+keyword.toUpperCase()+"%"); + ps.setInt(2, type); + ps.setInt(3, (page - 1) * pageSize); + ps.setInt(4, pageSize); + ResultSet rs = ps.executeQuery(); + while (rs.next()) { + courseList.add(fillCourseInfo(rs)); + } + DBTool.close(ps, rs); + } catch (SQLException e) { + throw new RuntimeException(e); + } + return courseList; + } + + @Override + public CourseInfo getCourseInfoByID(int id) { + CourseInfo courseInfo = null; + try { + PreparedStatement ps = DBTool.getPreparedStatement("select * from t_course WHERE N_COURSE_ID = ?"); + ps.setInt(1, id); + ResultSet rs = ps.executeQuery(); + while (rs.next()) { + String name = rs.getString("VC_COURSE_NAME"); + int type = rs.getInt("N_TYPE"); + float credits = rs.getFloat("F_CREDIT"); + int grade = rs.getInt("N_GRADE"); + int major = rs.getInt("N_MAJOR"); + String detail = rs.getString("VC_DETAIL"); + courseInfo = new CourseInfo(id, name, type, credits, grade, major, detail); + } + DBTool.close(ps, rs); + } catch (SQLException e) { + throw new RuntimeException(e); + } + return courseInfo; + } + + @Override + public int getAllCourseInfoCount() { + int count = 0; + String sql = "SELECT COUNT(*) FROM t_course"; + try { + PreparedStatement ps = DBTool.getPreparedStatement(sql); + ResultSet rs = ps.executeQuery(); + if (rs.next()) { + count = rs.getInt(1); + } + DBTool.close(ps, rs); + } catch (SQLException e) { + return -1; + } + return count; + } + + @Override + public int getAllCourseInfoCount(String keyword, int type) { + int count = 0; + String sql = "SELECT COUNT(*) FROM t_course WHERE UPPER(VC_COURSE_NAME) LIKE ? AND ? IN (N_TYPE, 0)"; + try { + PreparedStatement ps = DBTool.getPreparedStatement(sql); + ps.setString(1, "%"+keyword.toUpperCase()+"%"); + ps.setInt(2, type); + ResultSet rs = ps.executeQuery(); + if (rs.next()) { + count = rs.getInt(1); + } + DBTool.close(ps, rs); + } catch (SQLException e) { + return -1; + } + return count; + } + + @Override + public int addCourseInfo(CourseInfo courseInfo) { + int lines; + try { + String sql = "INSERT INTO t_course (VC_COURSE_NAME, N_TYPE, F_CREDIT, N_GRADE, N_MAJOR, VC_DETAIL) VALUES(?, ?, ?, ?, ?, ?)"; + PreparedStatement ps = DBTool.getPreparedStatement(sql); + ps.setString(1, courseInfo.getName()); + ps.setInt(2, courseInfo.getType()); + ps.setFloat(3, courseInfo.getCredit()); + ps.setInt(4, courseInfo.getGrade()); + ps.setInt(5, courseInfo.getMajor()); + ps.setString(6, courseInfo.getDetail()); + lines = ps.executeUpdate(); + DBTool.close(ps); + } catch (SQLException e) { + throw new RuntimeException(e); + } + return lines; + } + + @Override + public int updateCourseInfo(CourseInfo courseInfo) { + int lines; + try { + PreparedStatement ps = DBTool.getPreparedStatement("UPDATE t_course SET VC_COURSE_NAME = ?," + + " N_TYPE = ?, F_CREDIT = ?, N_GRADE = ?, N_MAJOR = ?, VC_DETAIL = ? WHERE N_COURSE_ID = ?"); + ps.setString(1, courseInfo.getName()); + ps.setInt(2, courseInfo.getType()); + ps.setFloat(3, courseInfo.getCredit()); + ps.setInt(4, courseInfo.getGrade()); + ps.setInt(5, courseInfo.getMajor()); + ps.setString(6, courseInfo.getDetail()); + ps.setInt(7, courseInfo.getId()); + lines = ps.executeUpdate(); + DBTool.close(ps); + } catch (SQLException e) { + throw new RuntimeException(e); + } + return lines; + } + + @Override + public int deleteCourseInfo(int id) { + int lines; + try { + String sql = "DELETE FROM t_course WHERE N_COURSE_ID = ?"; + PreparedStatement ps = DBTool.getPreparedStatement(sql); + ps.setInt(1, id); + lines = ps.executeUpdate(); + DBTool.close(ps); + } catch (SQLException e) { + throw new RuntimeException(e); + } + return lines; + } +} diff --git a/learn02/src/dao/impl/TeacherDBImpl.java b/learn02/src/dao/impl/TeacherDBImpl.java new file mode 100644 index 0000000..730fc7b --- /dev/null +++ b/learn02/src/dao/impl/TeacherDBImpl.java @@ -0,0 +1,60 @@ +package dao.impl; + +import common.DBTool; +import dao.TeacherDB; +import pojo.TeacherInfo; + +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; + +public class TeacherDBImpl implements TeacherDB { + @Override + public ArrayList getAllTeacherInfo() { + ArrayList teacherInfos = new ArrayList<>(); + String sql = "select * from t_teacher"; + try{ + PreparedStatement ps = DBTool.getPreparedStatement(sql); + ResultSet rs = ps.executeQuery(); + while(rs.next()){ + TeacherInfo teacherInfo = new TeacherInfo(); + teacherInfo.setId(rs.getInt("N_TEACHER_ID")); + teacherInfo.setName(rs.getString("VC_TEACHER_NAME")); + teacherInfo.setSex(rs.getInt("N_SEX")); + teacherInfo.setBrith(rs.getString("VC_BIRTH")); + teacherInfo.setEduc(rs.getInt("N_EDUC")); + teacherInfo.setTitle(rs.getInt("N_TITLE")); + teacherInfos.add(teacherInfo); + } + } catch (SQLException e) { + throw new RuntimeException(e); + } + return teacherInfos; + } + + @Override + public TeacherInfo getTeacherInfoByID(int id) { + return null; + } + + @Override + public TeacherInfo getTeacherInfoByName(String name) { + return null; + } + + @Override + public int addTeacherInfo(TeacherInfo teacherInfo) { + return 0; + } + + @Override + public int updateTeacherInfo(TeacherInfo teacherInfo) { + return 0; + } + + @Override + public int deleteTeacherInfo(int id) { + return 0; + } +} diff --git a/learn02/src/dao/impl/UserDBImpl.java b/learn02/src/dao/impl/UserDBImpl.java new file mode 100644 index 0000000..a394885 --- /dev/null +++ b/learn02/src/dao/impl/UserDBImpl.java @@ -0,0 +1,103 @@ +package dao.impl; + +import common.DBTool; +import dao.UserDB; +import pojo.UserInfo; + +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; + +public class UserDBImpl implements UserDB { + + @Override + public UserInfo getUserByName(String username) { + UserInfo u = new UserInfo(); + ResultSet rs = null; + try{ + String sql = "select * from t_user where VC_LOGIN_NAME = ?"; + PreparedStatement ps = DBTool.getPreparedStatement(sql); + ps.setString(1, username); + rs = ps.executeQuery(); + if(rs.next()) { + u.setId(rs.getInt("N_USER_ID")); + u.setName(rs.getString("VC_LOGIN_NAME")); + u.setPass(rs.getString("VC_PASSWORD")); + }else{ + u = null; + } + DBTool.close(ps, rs); + } catch (SQLException e) { + throw new RuntimeException(e); + } + return u; + } + + @Override + public UserInfo getUserById(int id) { + UserInfo u = new UserInfo(); + ResultSet rs = null; + try{ + String sql = "select * from t_user where N_USER_ID = ?"; + PreparedStatement ps = DBTool.getPreparedStatement(sql); + ps.setInt(1, id); + rs = ps.executeQuery(); + if(rs.next()) { + u.setId(rs.getInt("N_USER_ID")); + u.setName(rs.getString("VC_LOGIN_NAME")); + u.setPass(rs.getString("VC_PASSWORD")); + }else{ + u = null; + } + DBTool.close(ps, rs); + } catch (SQLException e) { + throw new RuntimeException(e); + } + return u; + } + + @Override + public int addUser(UserInfo user) { + int lines = 0; + String sql = "INSERT INTO t_user (VC_LOGIN_NAME, VC_PASSWORD) VALUES (?, ?)"; + try{ + PreparedStatement ps = DBTool.getPreparedStatement(sql); + ps.setString(1, user.getName()); + ps.setString(2, user.getPass()); + lines = ps.executeUpdate(); + } catch (SQLException e) { + throw new RuntimeException(e); + } + return lines; + } + + @Override + public int updateUser(UserInfo user) { + int lines = 0; + String sql = "UPDATE t_user SET VC_PASSWORD = ?,VC_LOGIN_NAME = ? WHERE N_USER_ID = ?"; + try{ + PreparedStatement ps = DBTool.getPreparedStatement(sql); + ps.setString(1, user.getPass()); + ps.setString(2, user.getName()); + ps.setInt(3, user.getId()); + lines = ps.executeUpdate(); + } catch (SQLException e) { + throw new RuntimeException(e); + } + return lines; + } + + @Override + public int deleteUser(int id) { + int lines = 0; + String sql = "DELETE FROM t_user WHERE N_USER_ID = ?"; + try{ + PreparedStatement ps = DBTool.getPreparedStatement(sql); + ps.setInt(1, id); + lines = ps.executeUpdate(); + } catch (SQLException e) { + throw new RuntimeException(e); + } + return 0; + } +} diff --git a/learn02/src/database.properties b/learn02/src/database.properties new file mode 100644 index 0000000..8dcbcdd --- /dev/null +++ b/learn02/src/database.properties @@ -0,0 +1,41 @@ +#-------------------------------------------------------------------------------------------------- +#DriverClassName=com.mysql.cj.jdbc.Driver +#url=jdbc:mysql://10.19.38.253:3306/chat?useUnicode=true&characterEncoding=utf-8&useSSL=true +#username=admin +#password=1227496003131313xY +#-------------------------------------------------------------------------------------------------- +driverClassName=org.sqlite.JDBC +url=jdbc:sqlite:F:\\Work_Area\\desk\\database\\学习\\java测试数据库\\db_student.db +#-------------------------------------------------------------------------------------------------- + +defaultAutoCommit=true + +defaultReadOnly=false + +initialSize=10 + +maxActive=20 + +maxIdle=20 + +minIdle=5 + +maxWait=10000 + +testOnBorrow=true + +testOnReturn=false + +validationQuery=select 1 + +validationQueryTimeout=1 + +testWhileIdle=false + +timeBetweenEvictionRunsMillis=1 + +numTestsPerEvictionRun=3 + +poolPreparedStatements=true + +maxOpenPreparedStatements=3 \ No newline at end of file diff --git a/learn02/src/filters/GlobalFilter.java b/learn02/src/filters/GlobalFilter.java new file mode 100644 index 0000000..dbb5791 --- /dev/null +++ b/learn02/src/filters/GlobalFilter.java @@ -0,0 +1,17 @@ +package filters; + +import jakarta.servlet.*; +import jakarta.servlet.annotation.WebFilter; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + +import java.io.IOException; + + +public class GlobalFilter implements Filter { + @Override + public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { + filterChain.doFilter(servletRequest, servletResponse); + } + +} diff --git a/learn02/src/pojo/CourseInfo.java b/learn02/src/pojo/CourseInfo.java new file mode 100644 index 0000000..56d6b16 --- /dev/null +++ b/learn02/src/pojo/CourseInfo.java @@ -0,0 +1,33 @@ +package pojo; + +import lombok.*; + + + + +@AllArgsConstructor +@ToString +@NoArgsConstructor +@Data +public class CourseInfo { + private int id; + private String name; + private int type; + private float credit; + private int grade; + private int major; + private String detail; + + public String toJSON(){ + String json="{"; + json += "\"id\":"+id+","; + json += "\"name\":\""+name+"\","; + json += "\"type\":"+type+","; + json += "\"credit\":"+credit+","; + json += "\"grade\":"+grade+","; + json += "\"major\":"+major+","; + json += "\"detail\":\""+detail+"\""; + json += "}"; + return json; + } +} diff --git a/learn02/src/pojo/ScoreInfo.java b/learn02/src/pojo/ScoreInfo.java new file mode 100644 index 0000000..230292b --- /dev/null +++ b/learn02/src/pojo/ScoreInfo.java @@ -0,0 +1,25 @@ +package pojo; + + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.ToString; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@ToString +public class ScoreInfo { + private int studentId; + private int courseId; + private float score; + + public String toJSON(){ + String json = "{"; + json += "\"studentId\":" + studentId + ","; + json += "\"courseId\":" + courseId + ","; + json += "\"score\":" + score + ","; + return json + "}"; + } +} diff --git a/learn02/src/pojo/StudentInfo.java b/learn02/src/pojo/StudentInfo.java new file mode 100644 index 0000000..b9ad28f --- /dev/null +++ b/learn02/src/pojo/StudentInfo.java @@ -0,0 +1,32 @@ +package pojo; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.ToString; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@ToString +public class StudentInfo { + private int id; + private String code; + private String name; + private int sex; + private int grade; + private String major; + private String detail; + + public String toJSON(){ + String json = "{"; + json += "\"id\":" + id + ","; + json += "\"code\":" + code + ","; + json += "\"name\":" + name + ","; + json += "\"sex\":" + sex + ","; + json += "\"grade\":" + grade + ","; + json += "\"major\":" + major + ","; + json += "\"detail\":" + detail + ","; + return json + "}"; + } +} diff --git a/learn02/src/pojo/TeacherInfo.java b/learn02/src/pojo/TeacherInfo.java new file mode 100644 index 0000000..f38d7c0 --- /dev/null +++ b/learn02/src/pojo/TeacherInfo.java @@ -0,0 +1,30 @@ +package pojo; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.ToString; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@ToString +public class TeacherInfo { + private int id; + private String name; + private int sex; + private String brith; + private int educ; + private int title; + + public String toJSON(){ + String json = "{"; + json += "\"id\":" + id + ","; + json += "\"name\":\"" + name + "\","; + json += "\"sex\":" + sex + ","; + json += "\"brith\":\"" + brith + "\","; + json += "\"educ\":" + educ + ","; + json += "\"title\":" + title + ","; + return json; + } +} diff --git a/learn02/src/pojo/UserInfo.java b/learn02/src/pojo/UserInfo.java new file mode 100644 index 0000000..c33276d --- /dev/null +++ b/learn02/src/pojo/UserInfo.java @@ -0,0 +1,25 @@ +package pojo; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.ToString; + +@AllArgsConstructor +@NoArgsConstructor +@Data +@ToString +public class UserInfo { + private int id; + private String name; + private String pass; + + public String toJSON(){ + String json = "{"; + json += "\"id\":" + id + ","; + json += "\"name\":\"" + name + "\","; + json += "\"pass\":\"" + pass; + json += "}"; + return json; + } +} \ No newline at end of file diff --git a/learn02/src/service/CourseService.java b/learn02/src/service/CourseService.java new file mode 100644 index 0000000..d17c4d6 --- /dev/null +++ b/learn02/src/service/CourseService.java @@ -0,0 +1,4 @@ +package service; + +public interface CourseService { +} diff --git a/learn02/src/service/UserService.java b/learn02/src/service/UserService.java new file mode 100644 index 0000000..29c0025 --- /dev/null +++ b/learn02/src/service/UserService.java @@ -0,0 +1,4 @@ +package service; + +public interface UserService { +} diff --git a/learn02/src/test/TestDao.java b/learn02/src/test/TestDao.java new file mode 100644 index 0000000..370dccb --- /dev/null +++ b/learn02/src/test/TestDao.java @@ -0,0 +1,15 @@ +package test; + +import dao.CourseDB; +import dao.impl.CourseDBImpl; +import pojo.CourseInfo; + +import java.util.ArrayList; + +public class TestDao { + public static void main(String[] args) { + CourseDB courseDB = new CourseDBImpl(); + ArrayList courseInfos = courseDB.getAllCourseInfo(); + System.out.println(courseInfos); + } +} diff --git a/learn02/web/course/course.jsp b/learn02/web/course/course.jsp new file mode 100644 index 0000000..1f732f2 --- /dev/null +++ b/learn02/web/course/course.jsp @@ -0,0 +1,63 @@ +<%-- + Created by IntelliJ IDEA. + User: 25589 + Date: 2024/11/21 + Time: 涓嬪崍5:00 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" %> + + + + + 璇剧▼淇℃伅鍒楄〃 + + + + +
+ +
+
+




+ + + + + + + + + + + + + + + + + + + + + + + + + + +
璇剧▼淇℃伅鍒楄〃
鍚嶇О鎬ц川瀛﹀垎寮璁惧勾绾寮璁句笓涓
{{course.name}}{{types[course.type]}}{{course.credit}}{{course.grade}}{{majors[course.major]}} + 缂栬緫 + 鍒犻櫎 +
娣诲姞 + 鍒锋柊鏁版嵁鍒楄〃 +
+
+ + + + + + diff --git a/learn02/web/course/course_edit.jsp b/learn02/web/course/course_edit.jsp new file mode 100644 index 0000000..124315e --- /dev/null +++ b/learn02/web/course/course_edit.jsp @@ -0,0 +1,87 @@ +<%@ page contentType="text/html;charset=UTF-8" language="java" %> +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
璇剧▼淇℃伅褰曞叆锛*浠h〃蹇呭~
+ + + *5~20浣嶅瓧绗 +
+ + + * +
+ + + *鏁板 +
+ + + *4浣嶆暟骞翠唤 +
寮璁句笓涓 + + + + + + + + * +
+ + + 200涓瓧绗︿互鍐 +
+ + +
+
+
\ No newline at end of file diff --git a/learn02/web/course/tmp b/learn02/web/course/tmp new file mode 100644 index 0000000..9fc8bda --- /dev/null +++ b/learn02/web/course/tmp @@ -0,0 +1,82 @@ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
璇剧▼淇℃伅褰曞叆锛*
+ + +*5~20浣嶅瓧绗 +
+ + +* +
+ + +*鏁板 +
+ + +*4浣嶆暟骞翠唤 +
寮璁句笓涓 + + + + + + + +* +
+ + +200涓瓧绗︿互鍐 +
+ +
+
\ No newline at end of file diff --git a/learn02/web/css/common.css b/learn02/web/css/common.css new file mode 100644 index 0000000..79935bb --- /dev/null +++ b/learn02/web/css/common.css @@ -0,0 +1,62 @@ +.container{ + background-color: white; + position: relative; + margin: auto; + width: 80%; +} + +body{ + background-color: white; +} + +a{ + text-decoration: none; + color: white; + font-weight: bold; +} + +table{ + width:100%; + border-spacing: 0; + background-color: #c4c4c4; +} + +tr{ + height: 25px; + padding: 2px; +} + +.tr-head{ + background-color: #2bf; + text-align: center; +} + +tr:nth-child(odd){ + background:#F4F4F4; +} + +button,.button{ + background-color: #39f; + border: #39f solid 1px; + border-radius: 5px; + color: white; + padding: 5px; + line-height: 100%; + text-align: center; + margin: 5px; +} + +.red { + COLOR: red +} + +.blue { + color: blue; +} + +.underline { + BORDER-BOTTOM: #c4c4c4 1pt solid; + BORDER-LEFT: #c4c4c4; + BORDER-RIGHT: #c4c4c4; + BORDER-TOP: #c4c4c4; +} \ No newline at end of file diff --git a/learn02/web/css/course.css b/learn02/web/css/course.css new file mode 100644 index 0000000..1f0b3d8 --- /dev/null +++ b/learn02/web/css/course.css @@ -0,0 +1,8 @@ +.input-form{ + border: black solid 1px; + margin: auto; + td{ + border: black solid 1px; + } +} + diff --git a/learn02/web/css/index.css b/learn02/web/css/index.css new file mode 100644 index 0000000..b934235 --- /dev/null +++ b/learn02/web/css/index.css @@ -0,0 +1,41 @@ +.nav-area{ + position: absolute; + top: 0; + left: 0; + background-color: #2bf; + height: 95%; + width: 20%; + margin: 0; + padding: 5px; +} + +.nav-list{ + padding-left: 0; + padding-right: 5px; +} + +.nav-item{ + list-style: none; + line-height: 100%; + text-align: center; + font-size: 19px; + margin: 5px 0; + padding: 3px 0; + color: white; + a{ + text-decoration: none; + color: white; + font-weight: bold; + } +} + +.content{ + position: absolute; + top: 0; + right: 0; + background-color: #eee; + height: 95%; + width: 79%; + margin: 0; + padding: 5px; +} \ No newline at end of file diff --git a/learn02/web/css/login.css b/learn02/web/css/login.css new file mode 100644 index 0000000..592ef0e --- /dev/null +++ b/learn02/web/css/login.css @@ -0,0 +1,15 @@ +.login-card{ + width: 80%; + border: #eee solid 2px; + border-radius: 5px; +} +input{ + width: 75%; + height: 35px; + border: grey solid 2px; + border-radius: 5px; + margin: 5px; + padding: 5px; + line-height: 100%; + text-align: center; +} diff --git a/learn02/web/error.jsp b/learn02/web/error.jsp new file mode 100644 index 0000000..0d92c44 --- /dev/null +++ b/learn02/web/error.jsp @@ -0,0 +1,16 @@ +<%@ page contentType="text/html;charset=UTF-8"%> + + + + + 瀛︾敓鏄熺郴绠$悊绯荤粺 + + +
+

閿欒锛

+

閿欒浠g爜锛<%=(request.getParameter("err-code") == null?"鏈煡閿欒":request.getParameter("err-code"))%>

+
+

<%=(request.getParameter("msg") == null?"":request.getParameter("msg"))%>

+
+ + \ No newline at end of file diff --git a/learn02/web/home.jsp b/learn02/web/home.jsp new file mode 100644 index 0000000..ffc552c --- /dev/null +++ b/learn02/web/home.jsp @@ -0,0 +1,44 @@ +<%-- + Created by IntelliJ IDEA. + User: 25589 + Date: 2024/12/3 + Time: 涓婂崍12:17 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" %> + + + 涓婚〉 + + + +
+

瀛︾敓淇℃伅绠$悊绯荤粺

+ + <% + if(session.getAttribute("user")==null){ + out.println(""); + }else{ + out.println(""); + } + %> +
+ + {{ message }} +

杩欐槸Hello vue

+

杩欎笉鏄疕ello vue

+
+
+ + + + diff --git a/learn02/web/index.jsp b/learn02/web/index.jsp index c0cede3..c753d55 100644 --- a/learn02/web/index.jsp +++ b/learn02/web/index.jsp @@ -1,16 +1,25 @@ <%-- Created by IntelliJ IDEA. - User: awinx - Date: 2024/12/5 - Time: 锟斤拷锟斤拷1:31 + User: 25589 + Date: 2024/11/28 + Time: 涓嬪崍1:20 To change this template use File | Settings | File Templates. --%> <%@ page contentType="text/html;charset=UTF-8"%> - $Title$ + 瀛︾敓淇℃伅绠$悊绯荤粺 + + - $END$ + + + diff --git a/learn02/web/js/course-edit.js b/learn02/web/js/course-edit.js new file mode 100644 index 0000000..8ec5b90 --- /dev/null +++ b/learn02/web/js/course-edit.js @@ -0,0 +1,145 @@ +const types = ['', '鍏叡鍩虹蹇呬慨璇', '鍏叡閫変慨璇', '瀛︾鍩虹璇', '涓撲笟蹇呬慨璇', '涓撲笟閫変慨璇', '闆嗕腑鎬у疄璺垫暀瀛︾幆鑺'] +const majors = ['', '杞欢宸ョ▼', '绌洪棿淇℃伅', '澶ф暟鎹']; +let courses; + +new Vue({ + el: "#course-list-vue", + data: { + courses: [], + types: types, + majors: majors, + path: path + }, + mounted(){ + $.ajax({ + url: path+"/courseAction/list", + method: "GET", + success: (data, status, xhr) =>{ + this.courses = data; + } + }); + }, + method: { + edit: ()=>{} + } +}); + +function getCourses(){ + // $.ajax({ + // url: path+"/courseAction/list", + // method: "GET", + // success: (data, status, xhr)=>{ + // const course_list = document.getElementById('course-list'); + // console.log(xhr.status); + // course_list.innerHTML = "璇剧▼淇℃伅鍒楄〃 鍚嶇О 鎬ц川 瀛﹀垎 寮璁惧勾绾 寮璁句笓涓 " + // courses = data; + // for (let i in data){ + // const course_tr = document.createElement('tr'); + // course_tr.innerHTML=""+ data[i].name +"" + + // ""+types[data[i].type]+"" + + // ""+ data[i].credit +"" + + // ""+ data[i].grade + "" + + // ""+ majors[data[i].major]+"" + + // "缂栬緫 鍒犻櫎"; + // course_list.appendChild(course_tr); + // } + // const end_tr = document.createElement('tr'); + // end_tr.innerHTML="娣诲姞" + + // "鍒锋柊鏁版嵁鍒楄〃"; + // course_list.appendChild(end_tr); + // }, + // error: ()=>{ + // window.location=path+"/login/login.jsp"; + // } + // }); +} +$(document).ready(getCourses); + +function editCourse(i){ + $(".course-editor").load(path+"/course/course_edit.jsp", ()=>{ + const form = document.querySelector('.course-edit'); + form.action = path+"/courseAction/update"; + form.method = "POST"; + const idInput = document.getElementById('id-input'); + idInput.value = courses[i].id; + const nameInput = document.getElementById('name-input'); + nameInput.value = courses[i].name; + const typeInput = document.getElementById('type-input'); + typeInput.value = courses[i].type; + const creditInput = document.getElementById('credit-input'); + creditInput.value = courses[i].credit; + const yearInput = document.getElementById('grade-input'); + yearInput.value = courses[i].grade; + const majorInputs = form.querySelectorAll('input[name="major"]'); + majorInputs.forEach((input) => { + if (parseInt(input.value) === courses[i].major) { + input.checked = true; + } + }); + + const noteInput = form.querySelector('#detail-input'); + noteInput.value = courses[i].detail; + + form.addEventListener('submit', function (e) { + e.preventDefault(); + const gradeInput = document.getElementById('grade-input'); + if (!/^20\d{2}$/.test(gradeInput.value)) { + alert('璇疯緭鍏ュ悎娉曠殑鍥涗綅骞翠唤'); + return; + } + + const nameInput = document.getElementById('name-input'); + console.log(nameInput.value.length) + console.log(nameInput.value) + if (nameInput.value.length < 5 || nameInput.value.length > 20){ + alert('璇疯緭鍏5~20浣嶅瓧绗'); + return; + } + const detailInput = document.getElementById('detail-input'); + if (detailInput.value.length > 200){ + alert('澶囨敞瓒呴暱'); + return; + } + $(".course-edit").submit(); + }); + }); +} + +function addCourse(){ + $(".course-editor").load(path+"/courseAction/course_edit.jsp", ()=>{ + const form = document.querySelector('.course-edit'); + form.action = path+"/course/add"; + form.addEventListener('submit', function (e) { + e.preventDefault(); + const gradeInput = document.getElementById('grade-input'); + if (!/^20\d{2}$/.test(gradeInput.value)) { + alert('璇疯緭鍏ュ悎娉曠殑鍥涗綅骞翠唤'); + return; + } + + const nameInput = document.getElementById('name-input'); + console.log(nameInput.value.length) + console.log(nameInput.value) + if (nameInput.value.length < 5 || nameInput.value.length > 20){ + alert('璇疯緭鍏5~20浣嶅瓧绗'); + return; + } + const detailInput = document.getElementById('detail-input'); + if (detailInput.value.length > 200){ + alert('澶囨敞瓒呴暱'); + return; + } + $(".course-edit").submit(); + }); + }); +} + +function closeEdit(){ + const editor = document.querySelector('.course-editor'); + editor.innerHTML = ""; +} + + + diff --git a/learn02/web/js/index.js b/learn02/web/js/index.js new file mode 100644 index 0000000..e69de29 diff --git a/learn02/web/js/jquery-3.7.1.min.js b/learn02/web/js/jquery-3.7.1.min.js new file mode 100644 index 0000000..7f37b5d --- /dev/null +++ b/learn02/web/js/jquery-3.7.1.min.js @@ -0,0 +1,2 @@ +/*! jQuery v3.7.1 | (c) OpenJS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(ie,e){"use strict";var oe=[],r=Object.getPrototypeOf,ae=oe.slice,g=oe.flat?function(e){return oe.flat.call(e)}:function(e){return oe.concat.apply([],e)},s=oe.push,se=oe.indexOf,n={},i=n.toString,ue=n.hasOwnProperty,o=ue.toString,a=o.call(Object),le={},v=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},y=function(e){return null!=e&&e===e.window},C=ie.document,u={type:!0,src:!0,nonce:!0,noModule:!0};function m(e,t,n){var r,i,o=(n=n||C).createElement("script");if(o.text=e,t)for(r in u)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[i.call(e)]||"object":typeof e}var t="3.7.1",l=/HTML$/i,ce=function(e,t){return new ce.fn.init(e,t)};function c(e){var t=!!e&&"length"in e&&e.length,n=x(e);return!v(e)&&!y(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+ge+")"+ge+"*"),x=new RegExp(ge+"|>"),j=new RegExp(g),A=new RegExp("^"+t+"$"),D={ID:new RegExp("^#("+t+")"),CLASS:new RegExp("^\\.("+t+")"),TAG:new RegExp("^("+t+"|[*])"),ATTR:new RegExp("^"+p),PSEUDO:new RegExp("^"+g),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ge+"*(even|odd|(([+-]|)(\\d*)n|)"+ge+"*(?:([+-]|)"+ge+"*(\\d+)|))"+ge+"*\\)|)","i"),bool:new RegExp("^(?:"+f+")$","i"),needsContext:new RegExp("^"+ge+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ge+"*((?:-\\d)?\\d*)"+ge+"*\\)|)(?=[^-]|$)","i")},N=/^(?:input|select|textarea|button)$/i,q=/^h\d$/i,L=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,H=/[+~]/,O=new RegExp("\\\\[\\da-fA-F]{1,6}"+ge+"?|\\\\([^\\r\\n\\f])","g"),P=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},M=function(){V()},R=J(function(e){return!0===e.disabled&&fe(e,"fieldset")},{dir:"parentNode",next:"legend"});try{k.apply(oe=ae.call(ye.childNodes),ye.childNodes),oe[ye.childNodes.length].nodeType}catch(e){k={apply:function(e,t){me.apply(e,ae.call(t))},call:function(e){me.apply(e,ae.call(arguments,1))}}}function I(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(V(e),e=e||T,C)){if(11!==p&&(u=L.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return k.call(n,a),n}else if(f&&(a=f.getElementById(i))&&I.contains(e,a)&&a.id===i)return k.call(n,a),n}else{if(u[2])return k.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&e.getElementsByClassName)return k.apply(n,e.getElementsByClassName(i)),n}if(!(h[t+" "]||d&&d.test(t))){if(c=t,f=e,1===p&&(x.test(t)||m.test(t))){(f=H.test(t)&&U(e.parentNode)||e)==e&&le.scope||((s=e.getAttribute("id"))?s=ce.escapeSelector(s):e.setAttribute("id",s=S)),o=(l=Y(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+Q(l[o]);c=l.join(",")}try{return k.apply(n,f.querySelectorAll(c)),n}catch(e){h(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return re(t.replace(ve,"$1"),e,n,r)}function W(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function F(e){return e[S]=!0,e}function $(e){var t=T.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function B(t){return function(e){return fe(e,"input")&&e.type===t}}function _(t){return function(e){return(fe(e,"input")||fe(e,"button"))&&e.type===t}}function z(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&R(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function X(a){return F(function(o){return o=+o,F(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function U(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function V(e){var t,n=e?e.ownerDocument||e:ye;return n!=T&&9===n.nodeType&&n.documentElement&&(r=(T=n).documentElement,C=!ce.isXMLDoc(T),i=r.matches||r.webkitMatchesSelector||r.msMatchesSelector,r.msMatchesSelector&&ye!=T&&(t=T.defaultView)&&t.top!==t&&t.addEventListener("unload",M),le.getById=$(function(e){return r.appendChild(e).id=ce.expando,!T.getElementsByName||!T.getElementsByName(ce.expando).length}),le.disconnectedMatch=$(function(e){return i.call(e,"*")}),le.scope=$(function(){return T.querySelectorAll(":scope")}),le.cssHas=$(function(){try{return T.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}}),le.getById?(b.filter.ID=function(e){var t=e.replace(O,P);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(O,P);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):t.querySelectorAll(e)},b.find.CLASS=function(e,t){if("undefined"!=typeof t.getElementsByClassName&&C)return t.getElementsByClassName(e)},d=[],$(function(e){var t;r.appendChild(e).innerHTML="",e.querySelectorAll("[selected]").length||d.push("\\["+ge+"*(?:value|"+f+")"),e.querySelectorAll("[id~="+S+"-]").length||d.push("~="),e.querySelectorAll("a#"+S+"+*").length||d.push(".#.+[+~]"),e.querySelectorAll(":checked").length||d.push(":checked"),(t=T.createElement("input")).setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),r.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&d.push(":enabled",":disabled"),(t=T.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||d.push("\\["+ge+"*name"+ge+"*="+ge+"*(?:''|\"\")")}),le.cssHas||d.push(":has"),d=d.length&&new RegExp(d.join("|")),l=function(e,t){if(e===t)return a=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!le.sortDetached&&t.compareDocumentPosition(e)===n?e===T||e.ownerDocument==ye&&I.contains(ye,e)?-1:t===T||t.ownerDocument==ye&&I.contains(ye,t)?1:o?se.call(o,e)-se.call(o,t):0:4&n?-1:1)}),T}for(e in I.matches=function(e,t){return I(e,null,null,t)},I.matchesSelector=function(e,t){if(V(e),C&&!h[t+" "]&&(!d||!d.test(t)))try{var n=i.call(e,t);if(n||le.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){h(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(O,P),e[3]=(e[3]||e[4]||e[5]||"").replace(O,P),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||I.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&I.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return D.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&j.test(n)&&(t=Y(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(O,P).toLowerCase();return"*"===e?function(){return!0}:function(e){return fe(e,t)}},CLASS:function(e){var t=s[e+" "];return t||(t=new RegExp("(^|"+ge+")"+e+"("+ge+"|$)"))&&s(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=I.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function T(e,n,r){return v(n)?ce.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?ce.grep(e,function(e){return e===n!==r}):"string"!=typeof n?ce.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(ce.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||k,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:S.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof ce?t[0]:t,ce.merge(this,ce.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:C,!0)),w.test(r[1])&&ce.isPlainObject(t))for(r in t)v(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=C.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(ce):ce.makeArray(e,this)}).prototype=ce.fn,k=ce(C);var E=/^(?:parents|prev(?:Until|All))/,j={children:!0,contents:!0,next:!0,prev:!0};function A(e,t){while((e=e[t])&&1!==e.nodeType);return e}ce.fn.extend({has:function(e){var t=ce(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,Ce=/^$|^module$|\/(?:java|ecma)script/i;xe=C.createDocumentFragment().appendChild(C.createElement("div")),(be=C.createElement("input")).setAttribute("type","radio"),be.setAttribute("checked","checked"),be.setAttribute("name","t"),xe.appendChild(be),le.checkClone=xe.cloneNode(!0).cloneNode(!0).lastChild.checked,xe.innerHTML="",le.noCloneChecked=!!xe.cloneNode(!0).lastChild.defaultValue,xe.innerHTML="",le.option=!!xe.lastChild;var ke={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function Se(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&fe(e,t)?ce.merge([e],n):n}function Ee(e,t){for(var n=0,r=e.length;n",""]);var je=/<|&#?\w+;/;function Ae(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function Re(e,t){return fe(e,"table")&&fe(11!==t.nodeType?t:t.firstChild,"tr")&&ce(e).children("tbody")[0]||e}function Ie(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function We(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Fe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(_.hasData(e)&&(s=_.get(e).events))for(i in _.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),C.head.appendChild(r[0])},abort:function(){i&&i()}}});var Jt,Kt=[],Zt=/(=)\?(?=&|$)|\?\?/;ce.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Kt.pop()||ce.expando+"_"+jt.guid++;return this[e]=!0,e}}),ce.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Zt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Zt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=v(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Zt,"$1"+r):!1!==e.jsonp&&(e.url+=(At.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||ce.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=ie[r],ie[r]=function(){o=arguments},n.always(function(){void 0===i?ce(ie).removeProp(r):ie[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Kt.push(r)),o&&v(i)&&i(o[0]),o=i=void 0}),"script"}),le.createHTMLDocument=((Jt=C.implementation.createHTMLDocument("").body).innerHTML="
",2===Jt.childNodes.length),ce.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(le.createHTMLDocument?((r=(t=C.implementation.createHTMLDocument("")).createElement("base")).href=C.location.href,t.head.appendChild(r)):t=C),o=!n&&[],(i=w.exec(e))?[t.createElement(i[1])]:(i=Ae([e],t,o),o&&o.length&&ce(o).remove(),ce.merge([],i.childNodes)));var r,i,o},ce.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(ce.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},ce.expr.pseudos.animated=function(t){return ce.grep(ce.timers,function(e){return t===e.elem}).length},ce.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=ce.css(e,"position"),c=ce(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=ce.css(e,"top"),u=ce.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),v(t)&&(t=t.call(e,n,ce.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},ce.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){ce.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===ce.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===ce.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=ce(e).offset()).top+=ce.css(e,"borderTopWidth",!0),i.left+=ce.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-ce.css(r,"marginTop",!0),left:t.left-i.left-ce.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===ce.css(e,"position"))e=e.offsetParent;return e||J})}}),ce.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;ce.fn[t]=function(e){return M(this,function(e,t,n){var r;if(y(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),ce.each(["top","left"],function(e,n){ce.cssHooks[n]=Ye(le.pixelPosition,function(e,t){if(t)return t=Ge(e,n),_e.test(t)?ce(e).position()[n]+"px":t})}),ce.each({Height:"height",Width:"width"},function(a,s){ce.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){ce.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return M(this,function(e,t,n){var r;return y(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?ce.css(e,t,i):ce.style(e,t,n,i)},s,n?e:void 0,n)}})}),ce.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){ce.fn[t]=function(e){return this.on(t,e)}}),ce.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.on("mouseenter",e).on("mouseleave",t||e)}}),ce.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){ce.fn[n]=function(e,t){return 0=0&&Math.floor(e)===e&&isFinite(t)}function f(t){return r(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function d(t){return null==t?"":Array.isArray(t)||u(t)&&t.toString===c?JSON.stringify(t,p,2):String(t)}function p(t,e){return e&&e.__v_isRef?e.value:e}function v(t){var e=parseFloat(t);return isNaN(e)?t:e}function h(t,e){for(var n=Object.create(null),r=t.split(","),o=0;o-1)return t.splice(r,1)}}var _=Object.prototype.hasOwnProperty;function b(t,e){return _.call(t,e)}function $(t){var e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}var w=/-(\w)/g,x=$((function(t){return t.replace(w,(function(t,e){return e?e.toUpperCase():""}))})),C=$((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})),k=/\B([A-Z])/g,S=$((function(t){return t.replace(k,"-$1").toLowerCase()}));var O=Function.prototype.bind?function(t,e){return t.bind(e)}:function(t,e){function n(n){var r=arguments.length;return r?r>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n};function T(t,e){e=e||0;for(var n=t.length-e,r=new Array(n);n--;)r[n]=t[n+e];return r}function A(t,e){for(var n in e)t[n]=e[n];return t}function j(t){for(var e={},n=0;n0,X=W&&W.indexOf("edge/")>0;W&&W.indexOf("android");var Y=W&&/iphone|ipad|ipod|ios/.test(W);W&&/chrome\/\d+/.test(W),W&&/phantomjs/.test(W);var Q,tt=W&&W.match(/firefox\/(\d+)/),et={}.watch,nt=!1;if(q)try{var rt={};Object.defineProperty(rt,"passive",{get:function(){nt=!0}}),window.addEventListener("test-passive",null,rt)}catch(t){}var ot=function(){return void 0===Q&&(Q=!q&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),Q},it=q&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function at(t){return"function"==typeof t&&/native code/.test(t.toString())}var st,ct="undefined"!=typeof Symbol&&at(Symbol)&&"undefined"!=typeof Reflect&&at(Reflect.ownKeys);st="undefined"!=typeof Set&&at(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var ut=null;function lt(t){void 0===t&&(t=null),t||ut&&ut._scope.off(),ut=t,t&&t._scope.on()}var ft=function(){function t(t,e,n,r,o,i,a,s){this.tag=t,this.data=e,this.children=n,this.text=r,this.elm=o,this.ns=void 0,this.context=i,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=e&&e.key,this.componentOptions=a,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=s,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1}return Object.defineProperty(t.prototype,"child",{get:function(){return this.componentInstance},enumerable:!1,configurable:!0}),t}(),dt=function(t){void 0===t&&(t="");var e=new ft;return e.text=t,e.isComment=!0,e};function pt(t){return new ft(void 0,void 0,void 0,String(t))}function vt(t){var e=new ft(t.tag,t.data,t.children&&t.children.slice(),t.text,t.elm,t.context,t.componentOptions,t.asyncFactory);return e.ns=t.ns,e.isStatic=t.isStatic,e.key=t.key,e.isComment=t.isComment,e.fnContext=t.fnContext,e.fnOptions=t.fnOptions,e.fnScopeId=t.fnScopeId,e.asyncMeta=t.asyncMeta,e.isCloned=!0,e}"function"==typeof SuppressedError&&SuppressedError;var ht=0,mt=[],gt=function(){for(var t=0;t0&&(ne((c=re(c,"".concat(a||"","_").concat(s)))[0])&&ne(l)&&(f[u]=pt(l.text+c[0].text),c.shift()),f.push.apply(f,c)):i(c)?ne(l)?f[u]=pt(l.text+c):""!==c&&f.push(pt(c)):ne(c)&&ne(l)?f[u]=pt(l.text+c.text):(o(t._isVList)&&r(c.tag)&&n(c.key)&&r(a)&&(c.key="__vlist".concat(a,"_").concat(s,"__")),f.push(c)));return f}var oe=1,ie=2;function ae(t,n,c,u,l,f){return(e(c)||i(c))&&(l=u,u=c,c=void 0),o(f)&&(l=ie),function(t,n,o,i,c){if(r(o)&&r(o.__ob__))return dt();r(o)&&r(o.is)&&(n=o.is);if(!n)return dt();e(i)&&a(i[0])&&((o=o||{}).scopedSlots={default:i[0]},i.length=0);c===ie?i=ee(i):c===oe&&(i=function(t){for(var n=0;n0,s=n?!!n.$stable:!a,c=n&&n.$key;if(n){if(n._normalized)return n._normalized;if(s&&o&&o!==t&&c===o.$key&&!a&&!o.$hasNormal)return o;for(var u in i={},n)n[u]&&"$"!==u[0]&&(i[u]=Oe(e,r,u,n[u]))}else i={};for(var l in r)l in i||(i[l]=Te(r,l));return n&&Object.isExtensible(n)&&(n._normalized=i),V(i,"$stable",s),V(i,"$key",c),V(i,"$hasNormal",a),i}function Oe(t,n,r,o){var i=function(){var n=ut;lt(t);var r=arguments.length?o.apply(null,arguments):o({}),i=(r=r&&"object"==typeof r&&!e(r)?[r]:ee(r))&&r[0];return lt(n),r&&(!i||1===r.length&&i.isComment&&!ke(i))?void 0:r};return o.proxy&&Object.defineProperty(n,r,{get:i,enumerable:!0,configurable:!0}),i}function Te(t,e){return function(){return t[e]}}function Ae(e){return{get attrs(){if(!e._attrsProxy){var n=e._attrsProxy={};V(n,"_v_attr_proxy",!0),je(n,e.$attrs,t,e,"$attrs")}return e._attrsProxy},get listeners(){e._listenersProxy||je(e._listenersProxy={},e.$listeners,t,e,"$listeners");return e._listenersProxy},get slots(){return function(t){t._slotsProxy||Ne(t._slotsProxy={},t.$scopedSlots);return t._slotsProxy}(e)},emit:O(e.$emit,e),expose:function(t){t&&Object.keys(t).forEach((function(n){return zt(e,t,n)}))}}}function je(t,e,n,r,o){var i=!1;for(var a in e)a in t?e[a]!==n[a]&&(i=!0):(i=!0,Ee(t,a,r,o));for(var a in t)a in e||(i=!0,delete t[a]);return i}function Ee(t,e,n,r){Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){return n[r][e]}})}function Ne(t,e){for(var n in e)t[n]=e[n];for(var n in t)n in e||delete t[n]}function Pe(){var t=ut;return t._setupContext||(t._setupContext=Ae(t))}var De,Me,Ie=null;function Le(t,e){return(t.__esModule||ct&&"Module"===t[Symbol.toStringTag])&&(t=t.default),s(t)?e.extend(t):t}function Re(t){if(e(t))for(var n=0;ndocument.createEvent("Event").timeStamp&&(on=function(){return an.now()})}var sn=function(t,e){if(t.post){if(!e.post)return 1}else if(e.post)return-1;return t.id-e.id};function cn(){var t,e;for(rn=on(),en=!0,Xe.sort(sn),nn=0;nnnn&&Xe[n].id>t.id;)n--;Xe.splice(n+1,0,t)}else Xe.push(t);tn||(tn=!0,En(cn))}}var ln="watcher",fn="".concat(ln," callback"),dn="".concat(ln," getter"),pn="".concat(ln," cleanup");function vn(t,e){return mn(t,null,{flush:"post"})}var hn={};function mn(n,r,o){var i=void 0===o?t:o,s=i.immediate,c=i.deep,u=i.flush,l=void 0===u?"pre":u;i.onTrack,i.onTrigger;var f,d,p=ut,v=function(t,e,n){void 0===n&&(n=null);var r=_n(t,null,n,p,e);return c&&r&&r.__ob__&&r.__ob__.dep.depend(),r},h=!1,m=!1;if(Bt(n)?(f=function(){return n.value},h=Rt(n)):Lt(n)?(f=function(){return n.__ob__.dep.depend(),n},c=!0):e(n)?(m=!0,h=n.some((function(t){return Lt(t)||Rt(t)})),f=function(){return n.map((function(t){return Bt(t)?t.value:Lt(t)?(t.__ob__.dep.depend(),Wn(t)):a(t)?v(t,dn):void 0}))}):f=a(n)?r?function(){return v(n,dn)}:function(){if(!p||!p._isDestroyed)return d&&d(),v(n,ln,[y])}:E,r&&c){var g=f;f=function(){return Wn(g())}}var y=function(t){d=_.onStop=function(){v(t,pn)}};if(ot())return y=E,r?s&&v(r,fn,[f(),m?[]:void 0,y]):f(),E;var _=new Xn(ut,f,E,{lazy:!0});_.noRecurse=!r;var b=m?[]:hn;return _.run=function(){if(_.active)if(r){var t=_.get();(c||h||(m?t.some((function(t,e){return L(t,b[e])})):L(t,b)))&&(d&&d(),v(r,fn,[t,b===hn?void 0:b,y]),b=t)}else _.get()},"sync"===l?_.update=_.run:"post"===l?(_.post=!0,_.update=function(){return un(_)}):_.update=function(){if(p&&p===ut&&!p._isMounted){var t=p._preWatchers||(p._preWatchers=[]);t.indexOf(_)<0&&t.push(_)}else un(_)},r?s?_.run():b=_.get():"post"===l&&p?p.$once("hook:mounted",(function(){return _.get()})):_.get(),function(){_.teardown()}}function gn(t){var e=t._provided,n=t.$parent&&t.$parent._provided;return n===e?t._provided=Object.create(n):e}function yn(t,e,n){bt();try{if(e)for(var r=e;r=r.$parent;){var o=r.$options.errorCaptured;if(o)for(var i=0;i1)return n&&a(e)?e.call(r):e}},h:function(t,e,n){return ae(ut,t,e,n,2,!0)},getCurrentInstance:function(){return ut&&{proxy:ut}},useSlots:function(){return Pe().slots},useAttrs:function(){return Pe().attrs},useListeners:function(){return Pe().listeners},mergeDefaults:function(t,n){var r=e(t)?t.reduce((function(t,e){return t[e]={},t}),{}):t;for(var o in n){var i=r[o];i?e(i)||a(i)?r[o]={type:i,default:n[o]}:i.default=n[o]:null===i&&(r[o]={default:n[o]})}return r},nextTick:En,set:Nt,del:Pt,useCssModule:function(e){return t},useCssVars:function(t){if(q){var e=ut;e&&vn((function(){var n=e.$el,r=t(e,e._setupProxy);if(n&&1===n.nodeType){var o=n.style;for(var i in r)o.setProperty("--".concat(i),r[i])}}))}},defineAsyncComponent:function(t){a(t)&&(t={loader:t});var e=t.loader,n=t.loadingComponent,r=t.errorComponent,o=t.delay,i=void 0===o?200:o,s=t.timeout;t.suspensible;var c=t.onError,u=null,l=0,f=function(){var t;return u||(t=u=e().catch((function(t){if(t=t instanceof Error?t:new Error(String(t)),c)return new Promise((function(e,n){c(t,(function(){return e((l++,u=null,f()))}),(function(){return n(t)}),l+1)}));throw t})).then((function(e){return t!==u&&u?u:(e&&(e.__esModule||"Module"===e[Symbol.toStringTag])&&(e=e.default),e)})))};return function(){return{component:f(),delay:i,timeout:s,error:r,loading:n}}},onBeforeMount:Pn,onMounted:Dn,onBeforeUpdate:Mn,onUpdated:In,onBeforeUnmount:Ln,onUnmounted:Rn,onActivated:Fn,onDeactivated:Hn,onServerPrefetch:Bn,onRenderTracked:Un,onRenderTriggered:zn,onErrorCaptured:function(t,e){void 0===e&&(e=ut),Vn(t,e)}}),qn=new st;function Wn(t){return Zn(t,qn),qn.clear(),t}function Zn(t,n){var r,o,i=e(t);if(!(!i&&!s(t)||t.__v_skip||Object.isFrozen(t)||t instanceof ft)){if(t.__ob__){var a=t.__ob__.dep.id;if(n.has(a))return;n.add(a)}if(i)for(r=t.length;r--;)Zn(t[r],n);else if(Bt(t))Zn(t.value,n);else for(r=(o=Object.keys(t)).length;r--;)Zn(t[o[r]],n)}}var Gn=0,Xn=function(){function t(t,e,n,r,o){!function(t,e){void 0===e&&(e=Me),e&&e.active&&e.effects.push(t)}(this,Me&&!Me._vm?Me:t?t._scope:void 0),(this.vm=t)&&o&&(t._watcher=this),r?(this.deep=!!r.deep,this.user=!!r.user,this.lazy=!!r.lazy,this.sync=!!r.sync,this.before=r.before):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++Gn,this.active=!0,this.post=!1,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new st,this.newDepIds=new st,this.expression="",a(e)?this.getter=e:(this.getter=function(t){if(!K.test(t)){var e=t.split(".");return function(t){for(var n=0;n-1)if(i&&!b(o,"default"))s=!1;else if(""===s||s===S(t)){var u=jr(String,o.type);(u<0||c-1:"string"==typeof t?t.split(",").indexOf(n)>-1:(r=t,"[object RegExp]"===c.call(r)&&t.test(n));var r}function Mr(t,e){var n=t.cache,r=t.keys,o=t._vnode,i=t.$vnode;for(var a in n){var s=n[a];if(s){var c=s.name;c&&!e(c)&&Ir(n,a,r,o)}}i.componentOptions.children=void 0}function Ir(t,e,n,r){var o=t[e];!o||r&&o.tag===r.tag||o.componentInstance.$destroy(),t[e]=null,y(n,e)}!function(e){e.prototype._init=function(e){var n=this;n._uid=sr++,n._isVue=!0,n.__v_skip=!0,n._scope=new ze(!0),n._scope.parent=void 0,n._scope._vm=!0,e&&e._isComponent?function(t,e){var n=t.$options=Object.create(t.constructor.options),r=e._parentVnode;n.parent=e.parent,n._parentVnode=r;var o=r.componentOptions;n.propsData=o.propsData,n._parentListeners=o.listeners,n._renderChildren=o.children,n._componentTag=o.tag,e.render&&(n.render=e.render,n.staticRenderFns=e.staticRenderFns)}(n,e):n.$options=Cr(cr(n.constructor),e||{},n),n._renderProxy=n,n._self=n,function(t){var e=t.$options,n=e.parent;if(n&&!e.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(t)}t.$parent=n,t.$root=n?n.$root:t,t.$children=[],t.$refs={},t._provided=n?n._provided:Object.create(null),t._watcher=null,t._inactive=null,t._directInactive=!1,t._isMounted=!1,t._isDestroyed=!1,t._isBeingDestroyed=!1}(n),function(t){t._events=Object.create(null),t._hasHookEvent=!1;var e=t.$options._parentListeners;e&&Ue(t,e)}(n),function(e){e._vnode=null,e._staticTrees=null;var n=e.$options,r=e.$vnode=n._parentVnode,o=r&&r.context;e.$slots=xe(n._renderChildren,o),e.$scopedSlots=r?Se(e.$parent,r.data.scopedSlots,e.$slots):t,e._c=function(t,n,r,o){return ae(e,t,n,r,o,!1)},e.$createElement=function(t,n,r,o){return ae(e,t,n,r,o,!0)};var i=r&&r.data;Et(e,"$attrs",i&&i.attrs||t,null,!0),Et(e,"$listeners",n._parentListeners||t,null,!0)}(n),Ge(n,"beforeCreate",void 0,!1),function(t){var e=ar(t.$options.inject,t);e&&(Ot(!1),Object.keys(e).forEach((function(n){Et(t,n,e[n])})),Ot(!0))}(n),tr(n),function(t){var e=t.$options.provide;if(e){var n=a(e)?e.call(t):e;if(!s(n))return;for(var r=gn(t),o=ct?Reflect.ownKeys(n):Object.keys(n),i=0;i1?T(n):n;for(var r=T(arguments,1),o='event handler for "'.concat(t,'"'),i=0,a=n.length;iparseInt(this.max)&&Ir(e,n[0],n,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var t in this.cache)Ir(this.cache,t,this.keys)},mounted:function(){var t=this;this.cacheVNode(),this.$watch("include",(function(e){Mr(t,(function(t){return Dr(e,t)}))})),this.$watch("exclude",(function(e){Mr(t,(function(t){return!Dr(e,t)}))}))},updated:function(){this.cacheVNode()},render:function(){var t=this.$slots.default,e=Re(t),n=e&&e.componentOptions;if(n){var r=Pr(n),o=this.include,i=this.exclude;if(o&&(!r||!Dr(o,r))||i&&r&&Dr(i,r))return e;var a=this.cache,s=this.keys,c=null==e.key?n.Ctor.cid+(n.tag?"::".concat(n.tag):""):e.key;a[c]?(e.componentInstance=a[c].componentInstance,y(s,c),s.push(c)):(this.vnodeToCache=e,this.keyToCache=c),e.data.keepAlive=!0}return e||t&&t[0]}},Fr={KeepAlive:Rr};!function(t){var e={get:function(){return B}};Object.defineProperty(t,"config",e),t.util={warn:gr,extend:A,mergeOptions:Cr,defineReactive:Et},t.set=Nt,t.delete=Pt,t.nextTick=En,t.observable=function(t){return jt(t),t},t.options=Object.create(null),F.forEach((function(e){t.options[e+"s"]=Object.create(null)})),t.options._base=t,A(t.options.components,Fr),function(t){t.use=function(t){var e=this._installedPlugins||(this._installedPlugins=[]);if(e.indexOf(t)>-1)return this;var n=T(arguments,1);return n.unshift(this),a(t.install)?t.install.apply(t,n):a(t)&&t.apply(null,n),e.push(t),this}}(t),function(t){t.mixin=function(t){return this.options=Cr(this.options,t),this}}(t),Nr(t),function(t){F.forEach((function(e){t[e]=function(t,n){return n?("component"===e&&u(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&a(n)&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}}))}(t)}(Er),Object.defineProperty(Er.prototype,"$isServer",{get:ot}),Object.defineProperty(Er.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(Er,"FunctionalRenderContext",{value:ur}),Er.version=Kn;var Hr=h("style,class"),Br=h("input,textarea,option,select,progress"),Ur=function(t,e,n){return"value"===n&&Br(t)&&"button"!==e||"selected"===n&&"option"===t||"checked"===n&&"input"===t||"muted"===n&&"video"===t},zr=h("contenteditable,draggable,spellcheck"),Vr=h("events,caret,typing,plaintext-only"),Kr=function(t,e){return Gr(e)||"false"===e?"false":"contenteditable"===t&&Vr(e)?e:"true"},Jr=h("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible"),qr="http://www.w3.org/1999/xlink",Wr=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},Zr=function(t){return Wr(t)?t.slice(6,t.length):""},Gr=function(t){return null==t||!1===t};function Xr(t){for(var e=t.data,n=t,o=t;r(o.componentInstance);)(o=o.componentInstance._vnode)&&o.data&&(e=Yr(o.data,e));for(;r(n=n.parent);)n&&n.data&&(e=Yr(e,n.data));return function(t,e){if(r(t)||r(e))return Qr(t,to(e));return""}(e.staticClass,e.class)}function Yr(t,e){return{staticClass:Qr(t.staticClass,e.staticClass),class:r(t.class)?[t.class,e.class]:e.class}}function Qr(t,e){return t?e?t+" "+e:t:e||""}function to(t){return Array.isArray(t)?function(t){for(var e,n="",o=0,i=t.length;o-1?Oo(t,e,n):Jr(e)?Gr(n)?t.removeAttribute(e):(n="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,n)):zr(e)?t.setAttribute(e,Kr(e,n)):Wr(e)?Gr(n)?t.removeAttributeNS(qr,Zr(e)):t.setAttributeNS(qr,e,n):Oo(t,e,n)}function Oo(t,e,n){if(Gr(n))t.removeAttribute(e);else{if(Z&&!G&&"TEXTAREA"===t.tagName&&"placeholder"===e&&""!==n&&!t.__ieph){var r=function(e){e.stopImmediatePropagation(),t.removeEventListener("input",r)};t.addEventListener("input",r),t.__ieph=!0}t.setAttribute(e,n)}}var To={create:ko,update:ko};function Ao(t,e){var o=e.elm,i=e.data,a=t.data;if(!(n(i.staticClass)&&n(i.class)&&(n(a)||n(a.staticClass)&&n(a.class)))){var s=Xr(e),c=o._transitionClasses;r(c)&&(s=Qr(s,to(c))),s!==o._prevClass&&(o.setAttribute("class",s),o._prevClass=s)}}var jo,Eo,No,Po,Do,Mo,Io={create:Ao,update:Ao},Lo=/[\w).+\-_$\]]/;function Ro(t){var e,n,r,o,i,a=!1,s=!1,c=!1,u=!1,l=0,f=0,d=0,p=0;for(r=0;r=0&&" "===(h=t.charAt(v));v--);h&&Lo.test(h)||(u=!0)}}else void 0===o?(p=r+1,o=t.slice(0,r).trim()):m();function m(){(i||(i=[])).push(t.slice(p,r).trim()),p=r+1}if(void 0===o?o=t.slice(0,r).trim():0!==p&&m(),i)for(r=0;r-1?{exp:t.slice(0,Po),key:'"'+t.slice(Po+1)+'"'}:{exp:t,key:null};Eo=t,Po=Do=Mo=0;for(;!ei();)ni(No=ti())?oi(No):91===No&&ri(No);return{exp:t.slice(0,Do),key:t.slice(Do+1,Mo)}}(t);return null===n.key?"".concat(t,"=").concat(e):"$set(".concat(n.exp,", ").concat(n.key,", ").concat(e,")")}function ti(){return Eo.charCodeAt(++Po)}function ei(){return Po>=jo}function ni(t){return 34===t||39===t}function ri(t){var e=1;for(Do=Po;!ei();)if(ni(t=ti()))oi(t);else if(91===t&&e++,93===t&&e--,0===e){Mo=Po;break}}function oi(t){for(var e=t;!ei()&&(t=ti())!==e;);}var ii,ai="__r",si="__c";function ci(t,e,n){var r=ii;return function o(){null!==e.apply(null,arguments)&&fi(t,o,n,r)}}var ui=xn&&!(tt&&Number(tt[1])<=53);function li(t,e,n,r){if(ui){var o=rn,i=e;e=i._wrapper=function(t){if(t.target===t.currentTarget||t.timeStamp>=o||t.timeStamp<=0||t.target.ownerDocument!==document)return i.apply(this,arguments)}}ii.addEventListener(t,e,nt?{capture:n,passive:r}:n)}function fi(t,e,n,r){(r||ii).removeEventListener(t,e._wrapper||e,n)}function di(t,e){if(!n(t.data.on)||!n(e.data.on)){var o=e.data.on||{},i=t.data.on||{};ii=e.elm||t.elm,function(t){if(r(t[ai])){var e=Z?"change":"input";t[e]=[].concat(t[ai],t[e]||[]),delete t[ai]}r(t[si])&&(t.change=[].concat(t[si],t.change||[]),delete t[si])}(o),Yt(o,i,li,fi,ci,e.context),ii=void 0}}var pi,vi={create:di,update:di,destroy:function(t){return di(t,vo)}};function hi(t,e){if(!n(t.data.domProps)||!n(e.data.domProps)){var i,a,s=e.elm,c=t.data.domProps||{},u=e.data.domProps||{};for(i in(r(u.__ob__)||o(u._v_attr_proxy))&&(u=e.data.domProps=A({},u)),c)i in u||(s[i]="");for(i in u){if(a=u[i],"textContent"===i||"innerHTML"===i){if(e.children&&(e.children.length=0),a===c[i])continue;1===s.childNodes.length&&s.removeChild(s.childNodes[0])}if("value"===i&&"PROGRESS"!==s.tagName){s._value=a;var l=n(a)?"":String(a);mi(s,l)&&(s.value=l)}else if("innerHTML"===i&&ro(s.tagName)&&n(s.innerHTML)){(pi=pi||document.createElement("div")).innerHTML="".concat(a,"");for(var f=pi.firstChild;s.firstChild;)s.removeChild(s.firstChild);for(;f.firstChild;)s.appendChild(f.firstChild)}else if(a!==c[i])try{s[i]=a}catch(t){}}}}function mi(t,e){return!t.composing&&("OPTION"===t.tagName||function(t,e){var n=!0;try{n=document.activeElement!==t}catch(t){}return n&&t.value!==e}(t,e)||function(t,e){var n=t.value,o=t._vModifiers;if(r(o)){if(o.number)return v(n)!==v(e);if(o.trim)return n.trim()!==e.trim()}return n!==e}(t,e))}var gi={create:hi,update:hi},yi=$((function(t){var e={},n=/:(.+)/;return t.split(/;(?![^(]*\))/g).forEach((function(t){if(t){var r=t.split(n);r.length>1&&(e[r[0].trim()]=r[1].trim())}})),e}));function _i(t){var e=bi(t.style);return t.staticStyle?A(t.staticStyle,e):e}function bi(t){return Array.isArray(t)?j(t):"string"==typeof t?yi(t):t}var $i,wi=/^--/,xi=/\s*!important$/,Ci=function(t,e,n){if(wi.test(e))t.style.setProperty(e,n);else if(xi.test(n))t.style.setProperty(S(e),n.replace(xi,""),"important");else{var r=Si(e);if(Array.isArray(n))for(var o=0,i=n.length;o-1?e.split(Ai).forEach((function(e){return t.classList.add(e)})):t.classList.add(e);else{var n=" ".concat(t.getAttribute("class")||""," ");n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function Ei(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(Ai).forEach((function(e){return t.classList.remove(e)})):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{for(var n=" ".concat(t.getAttribute("class")||""," "),r=" "+e+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?t.setAttribute("class",n):t.removeAttribute("class")}}function Ni(t){if(t){if("object"==typeof t){var e={};return!1!==t.css&&A(e,Pi(t.name||"v")),A(e,t),e}return"string"==typeof t?Pi(t):void 0}}var Pi=$((function(t){return{enterClass:"".concat(t,"-enter"),enterToClass:"".concat(t,"-enter-to"),enterActiveClass:"".concat(t,"-enter-active"),leaveClass:"".concat(t,"-leave"),leaveToClass:"".concat(t,"-leave-to"),leaveActiveClass:"".concat(t,"-leave-active")}})),Di=q&&!G,Mi="transition",Ii="animation",Li="transition",Ri="transitionend",Fi="animation",Hi="animationend";Di&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Li="WebkitTransition",Ri="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Fi="WebkitAnimation",Hi="webkitAnimationEnd"));var Bi=q?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()};function Ui(t){Bi((function(){Bi(t)}))}function zi(t,e){var n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),ji(t,e))}function Vi(t,e){t._transitionClasses&&y(t._transitionClasses,e),Ei(t,e)}function Ki(t,e,n){var r=qi(t,e),o=r.type,i=r.timeout,a=r.propCount;if(!o)return n();var s=o===Mi?Ri:Hi,c=0,u=function(){t.removeEventListener(s,l),n()},l=function(e){e.target===t&&++c>=a&&u()};setTimeout((function(){c0&&(n=Mi,l=a,f=i.length):e===Ii?u>0&&(n=Ii,l=u,f=c.length):f=(n=(l=Math.max(a,u))>0?a>u?Mi:Ii:null)?n===Mi?i.length:c.length:0,{type:n,timeout:l,propCount:f,hasTransform:n===Mi&&Ji.test(r[Li+"Property"])}}function Wi(t,e){for(;t.length1}function ta(t,e){!0!==e.data.show&&Gi(e)}var ea=function(t){var a,s,c={},u=t.modules,l=t.nodeOps;for(a=0;av?b(t,n(o[g+1])?null:o[g+1].elm,o,p,g,i):p>g&&w(e,f,v)}(f,h,m,i,u):r(m)?(r(t.text)&&l.setTextContent(f,""),b(f,null,m,0,m.length-1,i)):r(h)?w(h,0,h.length-1):r(t.text)&&l.setTextContent(f,""):t.text!==e.text&&l.setTextContent(f,e.text),r(v)&&r(p=v.hook)&&r(p=p.postpatch)&&p(t,e)}}}function S(t,e,n){if(o(n)&&r(t.parent))t.parent.data.pendingInsert=e;else for(var i=0;i-1,a.selected!==i&&(a.selected=i);else if(D(aa(a),r))return void(t.selectedIndex!==s&&(t.selectedIndex=s));o||(t.selectedIndex=-1)}}function ia(t,e){return e.every((function(e){return!D(e,t)}))}function aa(t){return"_value"in t?t._value:t.value}function sa(t){t.target.composing=!0}function ca(t){t.target.composing&&(t.target.composing=!1,ua(t.target,"input"))}function ua(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function la(t){return!t.componentInstance||t.data&&t.data.transition?t:la(t.componentInstance._vnode)}var fa={bind:function(t,e,n){var r=e.value,o=(n=la(n)).data&&n.data.transition,i=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;r&&o?(n.data.show=!0,Gi(n,(function(){t.style.display=i}))):t.style.display=r?i:"none"},update:function(t,e,n){var r=e.value;!r!=!e.oldValue&&((n=la(n)).data&&n.data.transition?(n.data.show=!0,r?Gi(n,(function(){t.style.display=t.__vOriginalDisplay})):Xi(n,(function(){t.style.display="none"}))):t.style.display=r?t.__vOriginalDisplay:"none")},unbind:function(t,e,n,r,o){o||(t.style.display=t.__vOriginalDisplay)}},da={model:na,show:fa},pa={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function va(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?va(Re(e.children)):t}function ha(t){var e={},n=t.$options;for(var r in n.propsData)e[r]=t[r];var o=n._parentListeners;for(var r in o)e[x(r)]=o[r];return e}function ma(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}var ga=function(t){return t.tag||ke(t)},ya=function(t){return"show"===t.name},_a={name:"transition",props:pa,abstract:!0,render:function(t){var e=this,n=this.$slots.default;if(n&&(n=n.filter(ga)).length){var r=this.mode,o=n[0];if(function(t){for(;t=t.parent;)if(t.data.transition)return!0}(this.$vnode))return o;var a=va(o);if(!a)return o;if(this._leaving)return ma(t,o);var s="__transition-".concat(this._uid,"-");a.key=null==a.key?a.isComment?s+"comment":s+a.tag:i(a.key)?0===String(a.key).indexOf(s)?a.key:s+a.key:a.key;var c=(a.data||(a.data={})).transition=ha(this),u=this._vnode,l=va(u);if(a.data.directives&&a.data.directives.some(ya)&&(a.data.show=!0),l&&l.data&&!function(t,e){return e.key===t.key&&e.tag===t.tag}(a,l)&&!ke(l)&&(!l.componentInstance||!l.componentInstance._vnode.isComment)){var f=l.data.transition=A({},c);if("out-in"===r)return this._leaving=!0,Qt(f,"afterLeave",(function(){e._leaving=!1,e.$forceUpdate()})),ma(t,o);if("in-out"===r){if(ke(a))return u;var d,p=function(){d()};Qt(c,"afterEnter",p),Qt(c,"enterCancelled",p),Qt(f,"delayLeave",(function(t){d=t}))}}return o}}},ba=A({tag:String,moveClass:String},pa);delete ba.mode;var $a={props:ba,beforeMount:function(){var t=this,e=this._update;this._update=function(n,r){var o=Je(t);t.__patch__(t._vnode,t.kept,!1,!0),t._vnode=t.kept,o(),e.call(t,n,r)}},render:function(t){for(var e=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,o=this.$slots.default||[],i=this.children=[],a=ha(this),s=0;s-1?ao[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:ao[t]=/HTMLUnknownElement/.test(e.toString())},A(Er.options.directives,da),A(Er.options.components,ka),Er.prototype.__patch__=q?ea:E,Er.prototype.$mount=function(t,e){return function(t,e,n){var r;t.$el=e,t.$options.render||(t.$options.render=dt),Ge(t,"beforeMount"),r=function(){t._update(t._render(),n)},new Xn(t,r,E,{before:function(){t._isMounted&&!t._isDestroyed&&Ge(t,"beforeUpdate")}},!0),n=!1;var o=t._preWatchers;if(o)for(var i=0;i\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,La=/^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+?\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,Ra="[a-zA-Z_][\\-\\.0-9_a-zA-Z".concat(U.source,"]*"),Fa="((?:".concat(Ra,"\\:)?").concat(Ra,")"),Ha=new RegExp("^<".concat(Fa)),Ba=/^\s*(\/?)>/,Ua=new RegExp("^<\\/".concat(Fa,"[^>]*>")),za=/^]+>/i,Va=/^",""":'"',"&":"&"," ":"\n"," ":"\t","'":"'"},Za=/&(?:lt|gt|quot|amp|#39);/g,Ga=/&(?:lt|gt|quot|amp|#39|#10|#9);/g,Xa=h("pre,textarea",!0),Ya=function(t,e){return t&&Xa(t)&&"\n"===e[0]};function Qa(t,e){var n=e?Ga:Za;return t.replace(n,(function(t){return Wa[t]}))}function ts(t,e){for(var n,r,o=[],i=e.expectHTML,a=e.isUnaryTag||N,s=e.canBeLeftOpenTag||N,c=0,u=function(){if(n=t,r&&Ja(r)){var u=0,d=r.toLowerCase(),p=qa[d]||(qa[d]=new RegExp("([\\s\\S]*?)(]*>)","i"));w=t.replace(p,(function(t,n,r){return u=r.length,Ja(d)||"noscript"===d||(n=n.replace(//g,"$1").replace(//g,"$1")),Ya(d,n)&&(n=n.slice(1)),e.chars&&e.chars(n),""}));c+=t.length-w.length,t=w,f(d,c-u,c)}else{var v=t.indexOf("<");if(0===v){if(Va.test(t)){var h=t.indexOf("--\x3e");if(h>=0)return e.shouldKeepComment&&e.comment&&e.comment(t.substring(4,h),c,c+h+3),l(h+3),"continue"}if(Ka.test(t)){var m=t.indexOf("]>");if(m>=0)return l(m+2),"continue"}var g=t.match(za);if(g)return l(g[0].length),"continue";var y=t.match(Ua);if(y){var _=c;return l(y[0].length),f(y[1],_,c),"continue"}var b=function(){var e=t.match(Ha);if(e){var n={tagName:e[1],attrs:[],start:c};l(e[0].length);for(var r=void 0,o=void 0;!(r=t.match(Ba))&&(o=t.match(La)||t.match(Ia));)o.start=c,l(o[0].length),o.end=c,n.attrs.push(o);if(r)return n.unarySlash=r[1],l(r[0].length),n.end=c,n}}();if(b)return function(t){var n=t.tagName,c=t.unarySlash;i&&("p"===r&&Ma(n)&&f(r),s(n)&&r===n&&f(n));for(var u=a(n)||!!c,l=t.attrs.length,d=new Array(l),p=0;p=0){for(w=t.slice(v);!(Ua.test(w)||Ha.test(w)||Va.test(w)||Ka.test(w)||(x=w.indexOf("<",1))<0);)v+=x,w=t.slice(v);$=t.substring(0,v)}v<0&&($=t),$&&l($.length),e.chars&&$&&e.chars($,c-$.length,c)}if(t===n)return e.chars&&e.chars(t),"break"};t;){if("break"===u())break}function l(e){c+=e,t=t.substring(e)}function f(t,n,i){var a,s;if(null==n&&(n=c),null==i&&(i=c),t)for(s=t.toLowerCase(),a=o.length-1;a>=0&&o[a].lowerCasedTag!==s;a--);else a=0;if(a>=0){for(var u=o.length-1;u>=a;u--)e.end&&e.end(o[u].tag,n,i);o.length=a,r=a&&o[a-1].tag}else"br"===s?e.start&&e.start(t,[],!0,n,i):"p"===s&&(e.start&&e.start(t,[],!1,n,i),e.end&&e.end(t,n,i))}f()}var es,ns,rs,os,is,as,ss,cs,us=/^@|^v-on:/,ls=/^v-|^@|^:|^#/,fs=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,ds=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,ps=/^\(|\)$/g,vs=/^\[.*\]$/,hs=/:(.*)$/,ms=/^:|^\.|^v-bind:/,gs=/\.[^.\]]+(?=[^\]]*$)/g,ys=/^v-slot(:|$)|^#/,_s=/[\r\n]/,bs=/[ \f\t\r\n]+/g,$s=$(Na),ws="_empty_";function xs(t,e,n){return{type:1,tag:t,attrsList:e,attrsMap:js(e),rawAttrsMap:{},parent:n,children:[]}}function Cs(t,e){es=e.warn||Ho,as=e.isPreTag||N,ss=e.mustUseProp||N,cs=e.getTagNamespace||N,e.isReservedTag,rs=Bo(e.modules,"transformNode"),os=Bo(e.modules,"preTransformNode"),is=Bo(e.modules,"postTransformNode"),ns=e.delimiters;var n,r,o=[],i=!1!==e.preserveWhitespace,a=e.whitespace,s=!1,c=!1;function u(t){if(l(t),s||t.processed||(t=ks(t,e)),o.length||t===n||n.if&&(t.elseif||t.else)&&Os(n,{exp:t.elseif,block:t}),r&&!t.forbidden)if(t.elseif||t.else)a=t,u=function(t){for(var e=t.length;e--;){if(1===t[e].type)return t[e];t.pop()}}(r.children),u&&u.if&&Os(u,{exp:a.elseif,block:a});else{if(t.slotScope){var i=t.slotTarget||'"default"';(r.scopedSlots||(r.scopedSlots={}))[i]=t}r.children.push(t),t.parent=r}var a,u;t.children=t.children.filter((function(t){return!t.slotScope})),l(t),t.pre&&(s=!1),as(t.tag)&&(c=!1);for(var f=0;fc&&(s.push(i=t.slice(c,o)),a.push(JSON.stringify(i)));var u=Ro(r[1].trim());a.push("_s(".concat(u,")")),s.push({"@binding":u}),c=o+r[0].length}return c-1")+("true"===i?":(".concat(e,")"):":_q(".concat(e,",").concat(i,")"))),qo(t,"change","var $$a=".concat(e,",")+"$$el=$event.target,"+"$$c=$$el.checked?(".concat(i,"):(").concat(a,");")+"if(Array.isArray($$a)){"+"var $$v=".concat(r?"_n("+o+")":o,",")+"$$i=_i($$a,$$v);"+"if($$el.checked){$$i<0&&(".concat(Qo(e,"$$a.concat([$$v])"),")}")+"else{$$i>-1&&(".concat(Qo(e,"$$a.slice(0,$$i).concat($$a.slice($$i+1))"),")}")+"}else{".concat(Qo(e,"$$c"),"}"),null,!0)}(t,r,o);else if("input"===i&&"radio"===a)!function(t,e,n){var r=n&&n.number,o=Wo(t,"value")||"null";o=r?"_n(".concat(o,")"):o,Uo(t,"checked","_q(".concat(e,",").concat(o,")")),qo(t,"change",Qo(e,o),null,!0)}(t,r,o);else if("input"===i||"textarea"===i)!function(t,e,n){var r=t.attrsMap.type,o=n||{},i=o.lazy,a=o.number,s=o.trim,c=!i&&"range"!==r,u=i?"change":"range"===r?ai:"input",l="$event.target.value";s&&(l="$event.target.value.trim()");a&&(l="_n(".concat(l,")"));var f=Qo(e,l);c&&(f="if($event.target.composing)return;".concat(f));Uo(t,"value","(".concat(e,")")),qo(t,u,f,null,!0),(s||a)&&qo(t,"blur","$forceUpdate()")}(t,r,o);else if(!B.isReservedTag(i))return Yo(t,r,o),!1;return!0},text:function(t,e){e.value&&Uo(t,"textContent","_s(".concat(e.value,")"),e)},html:function(t,e){e.value&&Uo(t,"innerHTML","_s(".concat(e.value,")"),e)}},Rs={expectHTML:!0,modules:Ds,directives:Ls,isPreTag:function(t){return"pre"===t},isUnaryTag:Pa,mustUseProp:Ur,canBeLeftOpenTag:Da,isReservedTag:oo,getTagNamespace:io,staticKeys:function(t){return t.reduce((function(t,e){return t.concat(e.staticKeys||[])}),[]).join(",")}(Ds)},Fs=$((function(t){return h("type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap"+(t?","+t:""))}));function Hs(t,e){t&&(Ms=Fs(e.staticKeys||""),Is=e.isReservedTag||N,Bs(t),Us(t,!1))}function Bs(t){if(t.static=function(t){if(2===t.type)return!1;if(3===t.type)return!0;return!(!t.pre&&(t.hasBindings||t.if||t.for||m(t.tag)||!Is(t.tag)||function(t){for(;t.parent;){if("template"!==(t=t.parent).tag)return!1;if(t.for)return!0}return!1}(t)||!Object.keys(t).every(Ms)))}(t),1===t.type){if(!Is(t.tag)&&"slot"!==t.tag&&null==t.attrsMap["inline-template"])return;for(var e=0,n=t.children.length;e|^function(?:\s+[\w$]+)?\s*\(/,Vs=/\([^)]*?\);*$/,Ks=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,Js={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},qs={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},Ws=function(t){return"if(".concat(t,")return null;")},Zs={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:Ws("$event.target !== $event.currentTarget"),ctrl:Ws("!$event.ctrlKey"),shift:Ws("!$event.shiftKey"),alt:Ws("!$event.altKey"),meta:Ws("!$event.metaKey"),left:Ws("'button' in $event && $event.button !== 0"),middle:Ws("'button' in $event && $event.button !== 1"),right:Ws("'button' in $event && $event.button !== 2")};function Gs(t,e){var n=e?"nativeOn:":"on:",r="",o="";for(var i in t){var a=Xs(t[i]);t[i]&&t[i].dynamic?o+="".concat(i,",").concat(a,","):r+='"'.concat(i,'":').concat(a,",")}return r="{".concat(r.slice(0,-1),"}"),o?n+"_d(".concat(r,",[").concat(o.slice(0,-1),"])"):n+r}function Xs(t){if(!t)return"function(){}";if(Array.isArray(t))return"[".concat(t.map((function(t){return Xs(t)})).join(","),"]");var e=Ks.test(t.value),n=zs.test(t.value),r=Ks.test(t.value.replace(Vs,""));if(t.modifiers){var o="",i="",a=[],s=function(e){if(Zs[e])i+=Zs[e],Js[e]&&a.push(e);else if("exact"===e){var n=t.modifiers;i+=Ws(["ctrl","shift","alt","meta"].filter((function(t){return!n[t]})).map((function(t){return"$event.".concat(t,"Key")})).join("||"))}else a.push(e)};for(var c in t.modifiers)s(c);a.length&&(o+=function(t){return"if(!$event.type.indexOf('key')&&"+"".concat(t.map(Ys).join("&&"),")return null;")}(a)),i&&(o+=i);var u=e?"return ".concat(t.value,".apply(null, arguments)"):n?"return (".concat(t.value,").apply(null, arguments)"):r?"return ".concat(t.value):t.value;return"function($event){".concat(o).concat(u,"}")}return e||n?t.value:"function($event){".concat(r?"return ".concat(t.value):t.value,"}")}function Ys(t){var e=parseInt(t,10);if(e)return"$event.keyCode!==".concat(e);var n=Js[t],r=qs[t];return"_k($event.keyCode,"+"".concat(JSON.stringify(t),",")+"".concat(JSON.stringify(n),",")+"$event.key,"+"".concat(JSON.stringify(r))+")"}var Qs={on:function(t,e){t.wrapListeners=function(t){return"_g(".concat(t,",").concat(e.value,")")}},bind:function(t,e){t.wrapData=function(n){return"_b(".concat(n,",'").concat(t.tag,"',").concat(e.value,",").concat(e.modifiers&&e.modifiers.prop?"true":"false").concat(e.modifiers&&e.modifiers.sync?",true":"",")")}},cloak:E},tc=function(t){this.options=t,this.warn=t.warn||Ho,this.transforms=Bo(t.modules,"transformCode"),this.dataGenFns=Bo(t.modules,"genData"),this.directives=A(A({},Qs),t.directives);var e=t.isReservedTag||N;this.maybeComponent=function(t){return!!t.component||!e(t.tag)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function ec(t,e){var n=new tc(e),r=t?"script"===t.tag?"null":nc(t,n):'_c("div")';return{render:"with(this){return ".concat(r,"}"),staticRenderFns:n.staticRenderFns}}function nc(t,e){if(t.parent&&(t.pre=t.pre||t.parent.pre),t.staticRoot&&!t.staticProcessed)return rc(t,e);if(t.once&&!t.onceProcessed)return oc(t,e);if(t.for&&!t.forProcessed)return sc(t,e);if(t.if&&!t.ifProcessed)return ic(t,e);if("template"!==t.tag||t.slotTarget||e.pre){if("slot"===t.tag)return function(t,e){var n=t.slotName||'"default"',r=fc(t,e),o="_t(".concat(n).concat(r?",function(){return ".concat(r,"}"):""),i=t.attrs||t.dynamicAttrs?vc((t.attrs||[]).concat(t.dynamicAttrs||[]).map((function(t){return{name:x(t.name),value:t.value,dynamic:t.dynamic}}))):null,a=t.attrsMap["v-bind"];!i&&!a||r||(o+=",null");i&&(o+=",".concat(i));a&&(o+="".concat(i?"":",null",",").concat(a));return o+")"}(t,e);var n=void 0;if(t.component)n=function(t,e,n){var r=e.inlineTemplate?null:fc(e,n,!0);return"_c(".concat(t,",").concat(cc(e,n)).concat(r?",".concat(r):"",")")}(t.component,t,e);else{var r=void 0,o=e.maybeComponent(t);(!t.plain||t.pre&&o)&&(r=cc(t,e));var i=void 0,a=e.options.bindings;o&&a&&!1!==a.__isScriptSetup&&(i=function(t,e){var n=x(e),r=C(n),o=function(o){return t[e]===o?e:t[n]===o?n:t[r]===o?r:void 0},i=o("setup-const")||o("setup-reactive-const");if(i)return i;var a=o("setup-let")||o("setup-ref")||o("setup-maybe-ref");if(a)return a}(a,t.tag)),i||(i="'".concat(t.tag,"'"));var s=t.inlineTemplate?null:fc(t,e,!0);n="_c(".concat(i).concat(r?",".concat(r):"").concat(s?",".concat(s):"",")")}for(var c=0;c>>0}(a)):"",")")}(t,t.scopedSlots,e),",")),t.model&&(n+="model:{value:".concat(t.model.value,",callback:").concat(t.model.callback,",expression:").concat(t.model.expression,"},")),t.inlineTemplate){var i=function(t,e){var n=t.children[0];if(n&&1===n.type){var r=ec(n,e.options);return"inlineTemplate:{render:function(){".concat(r.render,"},staticRenderFns:[").concat(r.staticRenderFns.map((function(t){return"function(){".concat(t,"}")})).join(","),"]}")}}(t,e);i&&(n+="".concat(i,","))}return n=n.replace(/,$/,"")+"}",t.dynamicAttrs&&(n="_b(".concat(n,',"').concat(t.tag,'",').concat(vc(t.dynamicAttrs),")")),t.wrapData&&(n=t.wrapData(n)),t.wrapListeners&&(n=t.wrapListeners(n)),n}function uc(t){return 1===t.type&&("slot"===t.tag||t.children.some(uc))}function lc(t,e){var n=t.attrsMap["slot-scope"];if(t.if&&!t.ifProcessed&&!n)return ic(t,e,lc,"null");if(t.for&&!t.forProcessed)return sc(t,e,lc);var r=t.slotScope===ws?"":String(t.slotScope),o="function(".concat(r,"){")+"return ".concat("template"===t.tag?t.if&&n?"(".concat(t.if,")?").concat(fc(t,e)||"undefined",":undefined"):fc(t,e)||"undefined":nc(t,e),"}"),i=r?"":",proxy:true";return"{key:".concat(t.slotTarget||'"default"',",fn:").concat(o).concat(i,"}")}function fc(t,e,n,r,o){var i=t.children;if(i.length){var a=i[0];if(1===i.length&&a.for&&"template"!==a.tag&&"slot"!==a.tag){var s=n?e.maybeComponent(a)?",1":",0":"";return"".concat((r||nc)(a,e)).concat(s)}var c=n?function(t,e){for(var n=0,r=0;r':'
',_c.innerHTML.indexOf(" ")>0}var xc=!!q&&wc(!1),Cc=!!q&&wc(!0),kc=$((function(t){var e=co(t);return e&&e.innerHTML})),Sc=Er.prototype.$mount;return Er.prototype.$mount=function(t,e){if((t=t&&co(t))===document.body||t===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"==typeof r)"#"===r.charAt(0)&&(r=kc(r));else{if(!r.nodeType)return this;r=r.innerHTML}else t&&(r=function(t){if(t.outerHTML)return t.outerHTML;var e=document.createElement("div");return e.appendChild(t.cloneNode(!0)),e.innerHTML}(t));if(r){var o=$c(r,{outputSourceRange:!1,shouldDecodeNewlines:xc,shouldDecodeNewlinesForHref:Cc,delimiters:n.delimiters,comments:n.comments},this),i=o.render,a=o.staticRenderFns;n.render=i,n.staticRenderFns=a}}return Sc.call(this,t,e)},Er.compile=$c,A(Er,Jn),Er.effect=function(t,e){var n=new Xn(ut,t,E,{sync:!0});e&&(n.update=function(){e((function(){return n.run()}))})},Er})); \ No newline at end of file diff --git a/learn02/web/login/login.jsp b/learn02/web/login/login.jsp new file mode 100644 index 0000000..0dcfddd --- /dev/null +++ b/learn02/web/login/login.jsp @@ -0,0 +1,41 @@ +<%-- + Created by IntelliJ IDEA. + User: 25589 + Date: 2024/12/1 + Time: 涓嬪崍11:58 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8"%> + + + 鐧诲綍 + + + + + + + + diff --git a/learn03-springboot/.gitattributes b/learn03-springboot/.gitattributes new file mode 100644 index 0000000..3b41682 --- /dev/null +++ b/learn03-springboot/.gitattributes @@ -0,0 +1,2 @@ +/mvnw text eol=lf +*.cmd text eol=crlf diff --git a/learn03-springboot/.gitignore b/learn03-springboot/.gitignore new file mode 100644 index 0000000..549e00a --- /dev/null +++ b/learn03-springboot/.gitignore @@ -0,0 +1,33 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ diff --git a/learn03-springboot/.mvn/wrapper/maven-wrapper.properties b/learn03-springboot/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 0000000..d58dfb7 --- /dev/null +++ b/learn03-springboot/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1,19 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +wrapperVersion=3.3.2 +distributionType=only-script +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip diff --git a/learn03-springboot/mvnw b/learn03-springboot/mvnw new file mode 100644 index 0000000..19529dd --- /dev/null +++ b/learn03-springboot/mvnw @@ -0,0 +1,259 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Apache Maven Wrapper startup batch script, version 3.3.2 +# +# Optional ENV vars +# ----------------- +# JAVA_HOME - location of a JDK home dir, required when download maven via java source +# MVNW_REPOURL - repo url base for downloading maven distribution +# MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven +# MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output +# ---------------------------------------------------------------------------- + +set -euf +[ "${MVNW_VERBOSE-}" != debug ] || set -x + +# OS specific support. +native_path() { printf %s\\n "$1"; } +case "$(uname)" in +CYGWIN* | MINGW*) + [ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")" + native_path() { cygpath --path --windows "$1"; } + ;; +esac + +# set JAVACMD and JAVACCMD +set_java_home() { + # For Cygwin and MinGW, ensure paths are in Unix format before anything is touched + if [ -n "${JAVA_HOME-}" ]; then + if [ -x "$JAVA_HOME/jre/sh/java" ]; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACCMD="$JAVA_HOME/jre/sh/javac" + else + JAVACMD="$JAVA_HOME/bin/java" + JAVACCMD="$JAVA_HOME/bin/javac" + + if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then + echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2 + echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2 + return 1 + fi + fi + else + JAVACMD="$( + 'set' +e + 'unset' -f command 2>/dev/null + 'command' -v java + )" || : + JAVACCMD="$( + 'set' +e + 'unset' -f command 2>/dev/null + 'command' -v javac + )" || : + + if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then + echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2 + return 1 + fi + fi +} + +# hash string like Java String::hashCode +hash_string() { + str="${1:-}" h=0 + while [ -n "$str" ]; do + char="${str%"${str#?}"}" + h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296)) + str="${str#?}" + done + printf %x\\n $h +} + +verbose() { :; } +[ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; } + +die() { + printf %s\\n "$1" >&2 + exit 1 +} + +trim() { + # MWRAPPER-139: + # Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds. + # Needed for removing poorly interpreted newline sequences when running in more + # exotic environments such as mingw bash on Windows. + printf "%s" "${1}" | tr -d '[:space:]' +} + +# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties +while IFS="=" read -r key value; do + case "${key-}" in + distributionUrl) distributionUrl=$(trim "${value-}") ;; + distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;; + esac +done <"${0%/*}/.mvn/wrapper/maven-wrapper.properties" +[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in ${0%/*}/.mvn/wrapper/maven-wrapper.properties" + +case "${distributionUrl##*/}" in +maven-mvnd-*bin.*) + MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ + case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in + *AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;; + :Darwin*x86_64) distributionPlatform=darwin-amd64 ;; + :Darwin*arm64) distributionPlatform=darwin-aarch64 ;; + :Linux*x86_64*) distributionPlatform=linux-amd64 ;; + *) + echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2 + distributionPlatform=linux-amd64 + ;; + esac + distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip" + ;; +maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;; +*) MVN_CMD="mvn${0##*/mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;; +esac + +# apply MVNW_REPOURL and calculate MAVEN_HOME +# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-,maven-mvnd--}/ +[ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}" +distributionUrlName="${distributionUrl##*/}" +distributionUrlNameMain="${distributionUrlName%.*}" +distributionUrlNameMain="${distributionUrlNameMain%-bin}" +MAVEN_USER_HOME="${MAVEN_USER_HOME:-${HOME}/.m2}" +MAVEN_HOME="${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")" + +exec_maven() { + unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || : + exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD" +} + +if [ -d "$MAVEN_HOME" ]; then + verbose "found existing MAVEN_HOME at $MAVEN_HOME" + exec_maven "$@" +fi + +case "${distributionUrl-}" in +*?-bin.zip | *?maven-mvnd-?*-?*.zip) ;; +*) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;; +esac + +# prepare tmp dir +if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then + clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; } + trap clean HUP INT TERM EXIT +else + die "cannot create temp dir" +fi + +mkdir -p -- "${MAVEN_HOME%/*}" + +# Download and Install Apache Maven +verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." +verbose "Downloading from: $distributionUrl" +verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" + +# select .zip or .tar.gz +if ! command -v unzip >/dev/null; then + distributionUrl="${distributionUrl%.zip}.tar.gz" + distributionUrlName="${distributionUrl##*/}" +fi + +# verbose opt +__MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR='' +[ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v + +# normalize http auth +case "${MVNW_PASSWORD:+has-password}" in +'') MVNW_USERNAME='' MVNW_PASSWORD='' ;; +has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;; +esac + +if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then + verbose "Found wget ... using wget" + wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl" +elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then + verbose "Found curl ... using curl" + curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl" +elif set_java_home; then + verbose "Falling back to use Java to download" + javaSource="$TMP_DOWNLOAD_DIR/Downloader.java" + targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName" + cat >"$javaSource" <<-END + public class Downloader extends java.net.Authenticator + { + protected java.net.PasswordAuthentication getPasswordAuthentication() + { + return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() ); + } + public static void main( String[] args ) throws Exception + { + setDefault( new Downloader() ); + java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() ); + } + } + END + # For Cygwin/MinGW, switch paths to Windows format before running javac and java + verbose " - Compiling Downloader.java ..." + "$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java" + verbose " - Running Downloader.java ..." + "$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")" +fi + +# If specified, validate the SHA-256 sum of the Maven distribution zip file +if [ -n "${distributionSha256Sum-}" ]; then + distributionSha256Result=false + if [ "$MVN_CMD" = mvnd.sh ]; then + echo "Checksum validation is not supported for maven-mvnd." >&2 + echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 + exit 1 + elif command -v sha256sum >/dev/null; then + if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c >/dev/null 2>&1; then + distributionSha256Result=true + fi + elif command -v shasum >/dev/null; then + if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then + distributionSha256Result=true + fi + else + echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2 + echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 + exit 1 + fi + if [ $distributionSha256Result = false ]; then + echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2 + echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2 + exit 1 + fi +fi + +# unzip and move +if command -v unzip >/dev/null; then + unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip" +else + tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar" +fi +printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/mvnw.url" +mv -- "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME" + +clean || : +exec_maven "$@" diff --git a/learn03-springboot/mvnw.cmd b/learn03-springboot/mvnw.cmd new file mode 100644 index 0000000..249bdf3 --- /dev/null +++ b/learn03-springboot/mvnw.cmd @@ -0,0 +1,149 @@ +<# : batch portion +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM http://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Apache Maven Wrapper startup batch script, version 3.3.2 +@REM +@REM Optional ENV vars +@REM MVNW_REPOURL - repo url base for downloading maven distribution +@REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven +@REM MVNW_VERBOSE - true: enable verbose log; others: silence the output +@REM ---------------------------------------------------------------------------- + +@IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0) +@SET __MVNW_CMD__= +@SET __MVNW_ERROR__= +@SET __MVNW_PSMODULEP_SAVE=%PSModulePath% +@SET PSModulePath= +@FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @( + IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B) +) +@SET PSModulePath=%__MVNW_PSMODULEP_SAVE% +@SET __MVNW_PSMODULEP_SAVE= +@SET __MVNW_ARG0_NAME__= +@SET MVNW_USERNAME= +@SET MVNW_PASSWORD= +@IF NOT "%__MVNW_CMD__%"=="" (%__MVNW_CMD__% %*) +@echo Cannot start maven from wrapper >&2 && exit /b 1 +@GOTO :EOF +: end batch / begin powershell #> + +$ErrorActionPreference = "Stop" +if ($env:MVNW_VERBOSE -eq "true") { + $VerbosePreference = "Continue" +} + +# calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties +$distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl +if (!$distributionUrl) { + Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties" +} + +switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) { + "maven-mvnd-*" { + $USE_MVND = $true + $distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip" + $MVN_CMD = "mvnd.cmd" + break + } + default { + $USE_MVND = $false + $MVN_CMD = $script -replace '^mvnw','mvn' + break + } +} + +# apply MVNW_REPOURL and calculate MAVEN_HOME +# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-,maven-mvnd--}/ +if ($env:MVNW_REPOURL) { + $MVNW_REPO_PATTERN = if ($USE_MVND) { "/org/apache/maven/" } else { "/maven/mvnd/" } + $distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace '^.*'+$MVNW_REPO_PATTERN,'')" +} +$distributionUrlName = $distributionUrl -replace '^.*/','' +$distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$','' +$MAVEN_HOME_PARENT = "$HOME/.m2/wrapper/dists/$distributionUrlNameMain" +if ($env:MAVEN_USER_HOME) { + $MAVEN_HOME_PARENT = "$env:MAVEN_USER_HOME/wrapper/dists/$distributionUrlNameMain" +} +$MAVEN_HOME_NAME = ([System.Security.Cryptography.MD5]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join '' +$MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME" + +if (Test-Path -Path "$MAVEN_HOME" -PathType Container) { + Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME" + Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" + exit $? +} + +if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) { + Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl" +} + +# prepare tmp dir +$TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile +$TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir" +$TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null +trap { + if ($TMP_DOWNLOAD_DIR.Exists) { + try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } + catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } + } +} + +New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null + +# Download and Install Apache Maven +Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." +Write-Verbose "Downloading from: $distributionUrl" +Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" + +$webclient = New-Object System.Net.WebClient +if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) { + $webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD) +} +[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 +$webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null + +# If specified, validate the SHA-256 sum of the Maven distribution zip file +$distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum +if ($distributionSha256Sum) { + if ($USE_MVND) { + Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." + } + Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash + if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) { + Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property." + } +} + +# unzip and move +Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null +Rename-Item -Path "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" -NewName $MAVEN_HOME_NAME | Out-Null +try { + Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null +} catch { + if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) { + Write-Error "fail to move MAVEN_HOME" + } +} finally { + try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } + catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } +} + +Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" diff --git a/learn03-springboot/pom.xml b/learn03-springboot/pom.xml new file mode 100644 index 0000000..0dbb187 --- /dev/null +++ b/learn03-springboot/pom.xml @@ -0,0 +1,85 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 3.4.0 + + + top.awin-x + learn03-springboot + 0.0.1-SNAPSHOT + war + learn03-springboot + learn03-springboot + + + + + + + + + + + + + + + 21 + + + + org.springframework.boot + spring-boot-starter-web + + + + org.projectlombok + lombok + true + + + org.springframework.boot + spring-boot-starter-tomcat + provided + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + + org.projectlombok + lombok + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + org.projectlombok + lombok + + + + + + + + diff --git a/learn03-springboot/src/main/java/top/awin_x/learn/Learn03SpringbootApplication.java b/learn03-springboot/src/main/java/top/awin_x/learn/Learn03SpringbootApplication.java new file mode 100644 index 0000000..4a7f8bf --- /dev/null +++ b/learn03-springboot/src/main/java/top/awin_x/learn/Learn03SpringbootApplication.java @@ -0,0 +1,13 @@ +package top.awin_x.learn; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class Learn03SpringbootApplication { + + public static void main(String[] args) { + SpringApplication.run(Learn03SpringbootApplication.class, args); + } + +} diff --git a/learn03-springboot/src/main/java/top/awin_x/learn/ServletInitializer.java b/learn03-springboot/src/main/java/top/awin_x/learn/ServletInitializer.java new file mode 100644 index 0000000..9fbc510 --- /dev/null +++ b/learn03-springboot/src/main/java/top/awin_x/learn/ServletInitializer.java @@ -0,0 +1,13 @@ +package top.awin_x.learn; + +import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; + +public class ServletInitializer extends SpringBootServletInitializer { + + @Override + protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { + return application.sources(Learn03SpringbootApplication.class); + } + +} diff --git a/learn03-springboot/src/main/resources/application.properties b/learn03-springboot/src/main/resources/application.properties new file mode 100644 index 0000000..45c4bb2 --- /dev/null +++ b/learn03-springboot/src/main/resources/application.properties @@ -0,0 +1 @@ +spring.application.name=learn03-springboot diff --git a/learn03-springboot/src/test/java/top/awin_x/learn/Learn03SpringbootApplicationTests.java b/learn03-springboot/src/test/java/top/awin_x/learn/Learn03SpringbootApplicationTests.java new file mode 100644 index 0000000..a78dccd --- /dev/null +++ b/learn03-springboot/src/test/java/top/awin_x/learn/Learn03SpringbootApplicationTests.java @@ -0,0 +1,13 @@ +package top.awin_x.learn; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class Learn03SpringbootApplicationTests { + + @Test + void contextLoads() { + } + +} diff --git a/learn1/src/course/CourseDB.java b/learn1/src/course/CourseDB.java index 766783e..52e601e 100644 --- a/learn1/src/course/CourseDB.java +++ b/learn1/src/course/CourseDB.java @@ -77,7 +77,7 @@ public class CourseDB { } public static void insertCourse(CourseInfo course){ - try{ + try { String sql = "INSERT INTO t_course (VC_COURSE_NAME, N_TYPE, F_CREDIT, N_GRADE, N_MAJOR, VC_DETAIL) VALUES(?, ?, ?, ?, ?, ?)"; PreparedStatement ps = DBTool.getPreparedStatement(sql); ps.setString(1, course.getName());