diff --git a/src/com/ssm/controller/YuyueController.java b/src/com/ssm/controller/StallController.java similarity index 51% rename from src/com/ssm/controller/YuyueController.java rename to src/com/ssm/controller/StallController.java index 8cc1721..fcda659 100644 --- a/src/com/ssm/controller/YuyueController.java +++ b/src/com/ssm/controller/StallController.java @@ -1,18 +1,18 @@ package com.ssm.controller; -import com.ssm.entity.YuyueModel; +import com.ssm.entity.StallModel; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @Controller -@RequestMapping("yuyue") -public class YuyueController { +@RequestMapping("stall") +public class StallController { //对象方式接收车辆预约信息 @RequestMapping("add") - public String test(YuyueModel yuyue){ - System.out.println("车辆预约信息:"+yuyue.toString()); - return "showYuyue"; + public String test(StallModel stall){ + System.out.println("车辆预约信息:"+stall.toString()); + return "showStall"; } } diff --git a/src/com/ssm/entity/StallModel.java b/src/com/ssm/entity/StallModel.java new file mode 100644 index 0000000..c42cb73 --- /dev/null +++ b/src/com/ssm/entity/StallModel.java @@ -0,0 +1,76 @@ +package com.ssm.entity; + + +/** + * 车位预约 + */ +public class StallModel { + /** + * 主键 + */ + private Integer stallphone; + // 车位价格 + public String stallprice; + + public int stallmessage;//车位信息 + + public String stallstate;//车位状态 + /** + * 预约用户 + */ + private UserModel user; + + + public Integer getStallphone() { + return stallphone; + } + + public void setStallphone(Integer stallphone) { + this.stallphone = stallphone; + } + + public String getStallprice() { + return stallprice; + } + + public void setStallprice(String stallprice) { + this.stallprice = stallprice; + } + + public int getStallmessage() { + return stallmessage; + } + + public void setStallmessage(int stallmessage) { + this.stallmessage = stallmessage; + } + + public String getStallstate() { + return stallstate; + } + + public void setStallstate(String stallstate) { + this.stallstate = stallstate; + } + + public UserModel getUser() { + return user; + } + + public void setUser(UserModel user) { + this.user = user; + } + + + @Override + public String toString() { + return "StallModel{" + + "电话=" + stallphone + + // 输出用户姓名 + ", 用户名=" + user.getUsername() + + // 输出停车区域名称 + ", 车位信息=" + stallmessage+ + ", 车位状态=" + stallstate + + '}'; + } +} diff --git a/src/com/ssm/entity/YuyueModel.java b/src/com/ssm/entity/YuyueModel.java deleted file mode 100644 index c3546f6..0000000 --- a/src/com/ssm/entity/YuyueModel.java +++ /dev/null @@ -1,115 +0,0 @@ -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/web/WEB-INF/view/showYuyue.jsp b/web/WEB-INF/view/showStall.jsp similarity index 100% rename from web/WEB-INF/view/showYuyue.jsp rename to web/WEB-INF/view/showStall.jsp diff --git a/web/addYuyue.jsp b/web/addStall.jsp similarity index 51% rename from web/addYuyue.jsp rename to web/addStall.jsp index ff2198f..c41be48 100644 --- a/web/addYuyue.jsp +++ b/web/addStall.jsp @@ -7,27 +7,39 @@