diff --git a/src/com/ssm/controller/FirstController.java b/src/com/ssm/controller/FirstController.java new file mode 100644 index 0000000..c08cd7e --- /dev/null +++ b/src/com/ssm/controller/FirstController.java @@ -0,0 +1,13 @@ +package com.ssm.controller; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; + +@Controller +public class FirstController { + @RequestMapping("hello") + public String hello() { + System.out.println("1111"); + return "showFirst"; + } +} diff --git a/src/com/ssm/controller/TingchequyuController.java b/src/com/ssm/controller/TingchequyuController.java new file mode 100644 index 0000000..ac91385 --- /dev/null +++ b/src/com/ssm/controller/TingchequyuController.java @@ -0,0 +1,22 @@ +package com.ssm.controller; + +import com.ssm.entity.TingchequyuModel; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.servlet.ModelAndView; + +@Controller +@RequestMapping("tingchequyu") +public class TingchequyuController { + + //对象方式接收数据,ModelAndView对象响应数据 + @RequestMapping("add") + public ModelAndView test(TingchequyuModel tingchequyu){ + //创建ModelAndView对象的同时设置了view的信息 + ModelAndView mv=new ModelAndView("showTingchequyu"); + //将这个对象showTingchequyu保存到ModelAndView对象中 + mv.addObject("tingchequyuInfo", tingchequyu); + return mv; + } + +} diff --git a/src/com/ssm/controller/YuyueController.java b/src/com/ssm/controller/YuyueController.java new file mode 100644 index 0000000..8cc1721 --- /dev/null +++ b/src/com/ssm/controller/YuyueController.java @@ -0,0 +1,18 @@ +package com.ssm.controller; + +import com.ssm.entity.YuyueModel; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; + +@Controller +@RequestMapping("yuyue") +public class YuyueController { + + //对象方式接收车辆预约信息 + @RequestMapping("add") + public String test(YuyueModel yuyue){ + System.out.println("车辆预约信息:"+yuyue.toString()); + return "showYuyue"; + } + +} diff --git a/src/com/ssm/entity/TingchequyuModel.java b/src/com/ssm/entity/TingchequyuModel.java new file mode 100644 index 0000000..f0fa11a --- /dev/null +++ b/src/com/ssm/entity/TingchequyuModel.java @@ -0,0 +1,129 @@ +package com.ssm.entity; + + +/** + * 停车区域 + */ +public class TingchequyuModel{ + /** + * 主键 + */ + private Integer id; + + + /** + * 区域名称 + */ + private String tingchequyuName; + + + /** + * 车位数量 + */ + private Integer tingchequyuNumber; + + + /** + * 详情信息 + */ + private String tingchequyuContent; + + + /** + * 录入时间 + */ + private String insertTime; + + + /** + * 创建时间 + */ + private String createTime; + + + /** + * 获取:主键 + */ + public Integer getId() { + return id; + } + + + /** + * 设置:主键 + */ + public void setId(Integer id) { + this.id = id; + } + /** + * 获取:区域名称 + */ + public String getTingchequyuName() { + return tingchequyuName; + } + + + /** + * 设置:区域名称 + */ + public void setTingchequyuName(String tingchequyuName) { + this.tingchequyuName = tingchequyuName; + } + /** + * 获取:车位数量 + */ + public Integer getTingchequyuNumber() { + return tingchequyuNumber; + } + + + /** + * 设置:车位数量 + */ + public void setTingchequyuNumber(Integer tingchequyuNumber) { + this.tingchequyuNumber = tingchequyuNumber; + } + /** + * 获取:详情信息 + */ + public String getTingchequyuContent() { + return tingchequyuContent; + } + + + /** + * 设置:详情信息 + */ + public void setTingchequyuContent(String tingchequyuContent) { + this.tingchequyuContent = tingchequyuContent; + } + /** + * 获取:录入时间 + */ + public String getInsertTime() { + return insertTime; + } + + + /** + * 设置:录入时间 + */ + public void setInsertTime(String insertTime) { + this.insertTime = insertTime; + } + /** + * 获取:创建时间 + */ + public String getCreateTime() { + return createTime; + } + + + /** + * 设置:创建时间 + */ + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + } diff --git a/src/com/ssm/entity/YonghuModel.java b/src/com/ssm/entity/YonghuModel.java new file mode 100644 index 0000000..4ee2e44 --- /dev/null +++ b/src/com/ssm/entity/YonghuModel.java @@ -0,0 +1,229 @@ +package com.ssm.entity; + + +/** + * 用户 + */ +public class YonghuModel{ + /** + * 主键 + */ + private Integer id; + + + /** + * 账户 + */ + private String username; + + + /** + * 密码 + */ + private String password; + + + /** + * 用户姓名 + */ + private String yonghuName; + + + /** + * 性别 + */ + private Integer sexTypes; + + + /** + * 身份证号 + */ + private String yonghuIdNumber; + + + /** + * 手机号 + */ + private String yonghuPhone; + + + /** + * 邮箱 + */ + private String yonghuEmail; + + + /** + * 专业班级 + */ + private String yonghuBanjiZhuanye; + + + /** + * 照片 + */ + private String yonghuPhoto; + + + /** + * 创建时间 + */ + private String createTime; + + + /** + * 获取:主键 + */ + public Integer getId() { + return id; + } + + + /** + * 设置:主键 + */ + public void setId(Integer id) { + this.id = id; + } + /** + * 获取:账户 + */ + public String getUsername() { + return username; + } + + + /** + * 设置:账户 + */ + public void setUsername(String username) { + this.username = username; + } + /** + * 获取:密码 + */ + public String getPassword() { + return password; + } + + + /** + * 设置:密码 + */ + public void setPassword(String password) { + this.password = password; + } + /** + * 获取:用户姓名 + */ + public String getYonghuName() { + return yonghuName; + } + + + /** + * 设置:用户姓名 + */ + public void setYonghuName(String yonghuName) { + this.yonghuName = yonghuName; + } + /** + * 获取:性别 + */ + public Integer getSexTypes() { + return sexTypes; + } + + + /** + * 设置:性别 + */ + public void setSexTypes(Integer sexTypes) { + this.sexTypes = sexTypes; + } + /** + * 获取:身份证号 + */ + public String getYonghuIdNumber() { + return yonghuIdNumber; + } + + + /** + * 设置:身份证号 + */ + public void setYonghuIdNumber(String yonghuIdNumber) { + this.yonghuIdNumber = yonghuIdNumber; + } + /** + * 获取:手机号 + */ + public String getYonghuPhone() { + return yonghuPhone; + } + + + /** + * 设置:手机号 + */ + public void setYonghuPhone(String yonghuPhone) { + this.yonghuPhone = yonghuPhone; + } + /** + * 获取:邮箱 + */ + public String getYonghuEmail() { + return yonghuEmail; + } + + + /** + * 设置:邮箱 + */ + public void setYonghuEmail(String yonghuEmail) { + this.yonghuEmail = yonghuEmail; + } + /** + * 获取:专业班级 + */ + public String getYonghuBanjiZhuanye() { + return yonghuBanjiZhuanye; + } + + + /** + * 设置:专业班级 + */ + public void setYonghuBanjiZhuanye(String yonghuBanjiZhuanye) { + this.yonghuBanjiZhuanye = yonghuBanjiZhuanye; + } + /** + * 获取:照片 + */ + public String getYonghuPhoto() { + return yonghuPhoto; + } + + + /** + * 设置:照片 + */ + public void setYonghuPhoto(String yonghuPhoto) { + this.yonghuPhoto = yonghuPhoto; + } + /** + * 获取:创建时间 + */ + public String getCreateTime() { + return createTime; + } + + + /** + * 设置:创建时间 + */ + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + } diff --git a/src/com/ssm/entity/YuyueModel.java b/src/com/ssm/entity/YuyueModel.java new file mode 100644 index 0000000..c3546f6 --- /dev/null +++ b/src/com/ssm/entity/YuyueModel.java @@ -0,0 +1,115 @@ +package com.ssm.entity; + + +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +/** + * 车位预约 + */ +public class YuyueModel { + /** + * 主键 + */ + private Integer id; + + + /** + * 预约用户 + */ + private YonghuModel yonghu; + + + /** + * 预约区域 + */ + private TingchequyuModel tingchequyu; + + + /** + * 预约时间 + */ + @DateTimeFormat(pattern = "yyyy-mm-dd HH:mm:ss") + private Date insertTime; + + + /** + * 创建时间 + */ + private Date createTime; + + + /** + * 获取:主键 + */ + public Integer getId() { + return id; + } + + + /** + * 设置:主键 + */ + public void setId(Integer id) { + this.id = id; + } + + public YonghuModel getYonghu() { + return yonghu; + } + + public void setYonghu(YonghuModel yonghu) { + this.yonghu = yonghu; + } + + public TingchequyuModel getTingchequyu() { + return tingchequyu; + } + + public void setTingchequyu(TingchequyuModel tingchequyu) { + this.tingchequyu = tingchequyu; + } + + /** + * 获取:预约时间 + */ + public Date getInsertTime() { + return insertTime; + } + + + /** + * 设置:预约时间 + */ + public void setInsertTime(Date insertTime) { + this.insertTime = insertTime; + } + + /** + * 获取:创建时间 + */ + public Date getCreateTime() { + return createTime; + } + + + /** + * 设置:创建时间 + */ + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + @Override + public String toString() { + return "YuyueModel{" + + "id=" + id + + // 输出用户姓名 + ", yonghuName=" + yonghu.getYonghuName() + + // 输出停车区域名称 + ", tingchequyuName=" + tingchequyu.getTingchequyuName() + + ", insertTime=" + insertTime + + '}'; + } +} diff --git a/src/springmvc.xml b/src/springmvc.xml new file mode 100644 index 0000000..a202e8b --- /dev/null +++ b/src/springmvc.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + diff --git a/web/WEB-INF/lib/commons-logging-1.2.jar b/web/WEB-INF/lib/commons-logging-1.2.jar new file mode 100644 index 0000000..93a3b9f Binary files /dev/null and b/web/WEB-INF/lib/commons-logging-1.2.jar differ diff --git a/web/WEB-INF/lib/jsp-api.jar b/web/WEB-INF/lib/jsp-api.jar new file mode 100644 index 0000000..d405b74 Binary files /dev/null and b/web/WEB-INF/lib/jsp-api.jar differ diff --git a/web/WEB-INF/lib/servlet-api.jar b/web/WEB-INF/lib/servlet-api.jar new file mode 100644 index 0000000..209d963 Binary files /dev/null and b/web/WEB-INF/lib/servlet-api.jar differ diff --git a/web/WEB-INF/lib/spring-aop-5.3.9.jar b/web/WEB-INF/lib/spring-aop-5.3.9.jar new file mode 100644 index 0000000..0228616 Binary files /dev/null and b/web/WEB-INF/lib/spring-aop-5.3.9.jar differ diff --git a/web/WEB-INF/lib/spring-beans-5.3.9.jar b/web/WEB-INF/lib/spring-beans-5.3.9.jar new file mode 100644 index 0000000..b250ccc Binary files /dev/null and b/web/WEB-INF/lib/spring-beans-5.3.9.jar differ diff --git a/web/WEB-INF/lib/spring-context-5.3.9.jar b/web/WEB-INF/lib/spring-context-5.3.9.jar new file mode 100644 index 0000000..48e3715 Binary files /dev/null and b/web/WEB-INF/lib/spring-context-5.3.9.jar differ diff --git a/web/WEB-INF/lib/spring-core-5.3.9.jar b/web/WEB-INF/lib/spring-core-5.3.9.jar new file mode 100644 index 0000000..e51f071 Binary files /dev/null and b/web/WEB-INF/lib/spring-core-5.3.9.jar differ diff --git a/web/WEB-INF/lib/spring-expression-5.3.9.jar b/web/WEB-INF/lib/spring-expression-5.3.9.jar new file mode 100644 index 0000000..42fcd3f Binary files /dev/null and b/web/WEB-INF/lib/spring-expression-5.3.9.jar differ diff --git a/web/WEB-INF/lib/spring-web-5.3.9.jar b/web/WEB-INF/lib/spring-web-5.3.9.jar new file mode 100644 index 0000000..d575c2b Binary files /dev/null and b/web/WEB-INF/lib/spring-web-5.3.9.jar differ diff --git a/web/WEB-INF/lib/spring-webmvc-5.3.9.jar b/web/WEB-INF/lib/spring-webmvc-5.3.9.jar new file mode 100644 index 0000000..168a85c Binary files /dev/null and b/web/WEB-INF/lib/spring-webmvc-5.3.9.jar differ diff --git a/web/WEB-INF/view/showFirst.jsp b/web/WEB-INF/view/showFirst.jsp new file mode 100644 index 0000000..3c42d25 --- /dev/null +++ b/web/WEB-INF/view/showFirst.jsp @@ -0,0 +1,12 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +展示入门程序信息 + + +Success! + + \ No newline at end of file diff --git a/web/WEB-INF/view/showTingchequyu.jsp b/web/WEB-INF/view/showTingchequyu.jsp new file mode 100644 index 0000000..e65e499 --- /dev/null +++ b/web/WEB-INF/view/showTingchequyu.jsp @@ -0,0 +1,20 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +展示商品分类信息 + + +Success! +
+区域编号:${tingchequyuInfo.id} +
+区域名称:${tingchequyuInfo.tingchequyuName} +
+车位数量:${tingchequyuInfo.tingchequyuNumber} +
+详情:${tingchequyuInfo.tingchequyuContent} + + \ No newline at end of file diff --git a/web/WEB-INF/view/showYuyue.jsp b/web/WEB-INF/view/showYuyue.jsp new file mode 100644 index 0000000..f44b357 --- /dev/null +++ b/web/WEB-INF/view/showYuyue.jsp @@ -0,0 +1,15 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +展示Controller接收及响应数据 + + +Success! +
+车位预约信息已在控制台输出! + + + \ No newline at end of file diff --git a/web/WEB-INF/web.xml b/web/WEB-INF/web.xml new file mode 100644 index 0000000..313ae7c --- /dev/null +++ b/web/WEB-INF/web.xml @@ -0,0 +1,43 @@ + + + SpringMVCFirst + + index.html + index.htm + index.jsp + default.html + default.htm + default.jsp + + + springDispatcherServlet + org.springframework.web.servlet.DispatcherServlet + + + contextConfigLocation + + classpath:springmvc.xml + + + 1 + + + springDispatcherServlet + + / + + + + characterEncodingFilter + org.springframework.web.filter.CharacterEncodingFilter + + encoding + UTF-8 + + + + characterEncodingFilter + /* + + + \ No newline at end of file diff --git a/web/addTingchequyu.jsp b/web/addTingchequyu.jsp new file mode 100644 index 0000000..7368a69 --- /dev/null +++ b/web/addTingchequyu.jsp @@ -0,0 +1,23 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +添加停车区域信息 + + +
+ 区域编号: +
+ 区域名称: +
+ 车位数量: +
+ 详情: +
+ +
+ + + \ No newline at end of file diff --git a/web/addYuyue.jsp b/web/addYuyue.jsp new file mode 100644 index 0000000..ff2198f --- /dev/null +++ b/web/addYuyue.jsp @@ -0,0 +1,42 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +添加车辆预约 + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
预约编号:
预约用户:
预约区域:
预约时间:
+ +
+
+ + \ No newline at end of file diff --git a/web/first.jsp b/web/first.jsp new file mode 100644 index 0000000..b5ff431 --- /dev/null +++ b/web/first.jsp @@ -0,0 +1,12 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +入门程序 + + +hello world + + \ No newline at end of file