From fb92684f162074e787cb979a31126cc3259f82d9 Mon Sep 17 00:00:00 2001 From: 15536166141 <3068510979@qq.com> Date: Wed, 26 Mar 2025 18:13:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=81=9C=E8=BD=A6=E8=BD=A6=E4=BD=8D=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E7=B1=BB=E5=9E=8B=E6=A8=A1=E5=9D=97=E7=9A=84=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B=E3=80=81=E8=A7=86=E5=9B=BE=E3=80=81=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=E5=99=A8=E7=9B=B8=E5=BA=94=E4=BB=A3=E7=A0=81=E7=9A=84=E7=BC=96?= =?UTF-8?q?=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/ssm/controller/NewTypeController.java | 15 +++ .../controller/TingchexinxiController.java | 15 +++ src/com/ssm/entity/NewTypeModel.java | 92 +++++++++++++++++++ src/com/ssm/entity/TingchexinxiModel.java | 66 +++++++++++++ web/WEB-INF/view/showNewType.jsp | 15 +++ web/WEB-INF/view/showTingchexinxi.jsp | 20 ++++ web/addNewType.jsp | 60 ++++++++++++ web/addTingchexinxi.jsp | 28 ++++++ 8 files changed, 311 insertions(+) create mode 100644 src/com/ssm/controller/NewTypeController.java create mode 100644 src/com/ssm/controller/TingchexinxiController.java create mode 100644 src/com/ssm/entity/NewTypeModel.java create mode 100644 src/com/ssm/entity/TingchexinxiModel.java create mode 100644 web/WEB-INF/view/showNewType.jsp create mode 100644 web/WEB-INF/view/showTingchexinxi.jsp create mode 100644 web/addNewType.jsp create mode 100644 web/addTingchexinxi.jsp diff --git a/src/com/ssm/controller/NewTypeController.java b/src/com/ssm/controller/NewTypeController.java new file mode 100644 index 0000000..84178e8 --- /dev/null +++ b/src/com/ssm/controller/NewTypeController.java @@ -0,0 +1,15 @@ +package com.ssm.controller; +import com.ssm.entity.NewTypeModel; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; + +@Controller +@RequestMapping("newtype") +public class NewTypeController { + //对象方式接收新闻类型信息 + @RequestMapping("add") + public String test(NewTypeModel newType) { + System.out.println("新闻类型信息" + newType.toString()); + return "showNewType"; + } +} diff --git a/src/com/ssm/controller/TingchexinxiController.java b/src/com/ssm/controller/TingchexinxiController.java new file mode 100644 index 0000000..ba6e5e7 --- /dev/null +++ b/src/com/ssm/controller/TingchexinxiController.java @@ -0,0 +1,15 @@ +package com.ssm.controller; + +import com.ssm.entity.NewTypeModel; +import com.ssm.entity.TingchexinxiModel; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +@Controller +@RequestMapping("tingchexinxi") +public class TingchexinxiController { + @RequestMapping("addtingchexinxi") + public String test(TingchexinxiModel tingchexinxiModel) { + System.out.println("停车车位信息" + tingchexinxiModel.toString()); + return "showTingchexinxi"; + } +} diff --git a/src/com/ssm/entity/NewTypeModel.java b/src/com/ssm/entity/NewTypeModel.java new file mode 100644 index 0000000..291d74f --- /dev/null +++ b/src/com/ssm/entity/NewTypeModel.java @@ -0,0 +1,92 @@ +package com.ssm.entity; + +import org.springframework.format.annotation.DateTimeFormat; +import java.util.Date; + +/** + * 新闻类型 + */ +public class NewTypeModel { + + + /** + * 主键 + */ +private Integer TYid; + + /** + * 父级分类 + */ + private Integer parentTypeId; + + /** + * 类型名称 + */ + private String typeName; + + /** + * 是否启用 + */ + private Boolean isEnabled; + + /** + * 创建时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + // 无参构造方法 + public NewTypeModel() {} + + // getter和setter方法 + public Integer getTYid() { + return TYid; + } + + public void setTYid(Integer TYid) { + this.TYid = TYid; + } + + public Integer getParentTypeId() { + return parentTypeId; + } + + public void setParentTypeId(Integer parentTypeId) { + this.parentTypeId = parentTypeId; + } + + public String getTypeName() { + return typeName; + } + + public void setTypeName(String typeName) { + this.typeName = typeName; + } + + public Boolean getIsEnabled() { + return isEnabled; + } + + public void setIsEnabled(Boolean isEnabled) { + this.isEnabled = isEnabled; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + @Override + public String toString() { + return "NewTypeModel{" + + "新闻类型编号=" + TYid + + ", 父级分类ID=" + parentTypeId + + ", 类型名称='" + typeName + '\'' + + ", 是否启用=" + isEnabled + + ", 创建时间=" + createTime + + '}'; + } +} \ No newline at end of file diff --git a/src/com/ssm/entity/TingchexinxiModel.java b/src/com/ssm/entity/TingchexinxiModel.java new file mode 100644 index 0000000..c8744de --- /dev/null +++ b/src/com/ssm/entity/TingchexinxiModel.java @@ -0,0 +1,66 @@ +package com.ssm.entity; + +import org.springframework.beans.factory.annotation.Value; + +public class TingchexinxiModel { + // 车位编号 + private String spaceNumber; + // 车位所在区域 + private String area; + // 车位类型(普通车位、残疾人车位) + private String spaceType; + + public String getSpaceNumber() { + return spaceNumber; + } + + public void setSpaceNumber(String spaceNumber) { + this.spaceNumber = spaceNumber; + } + + public String getArea() { + return area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getSpaceType() { + return spaceType; + } + + public void setSpaceType(String spaceType) { + this.spaceType = spaceType; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public double getPrice() { + return price; + } + + public void setPrice(double price) { + this.price = price; + } + + // 车位状态(空闲、已占用) + private String status; + // 车位价格 + private double price; + public void printInfo() { + System.out.println("ParkingLotSpace{" + + "车位编号=" + spaceNumber + + ", 车位所在区域='" + area + '\'' + + ", 车位类型='" + spaceType + '\'' + + ", 车位状态='" + status + '\'' + + ", 车位价格='" + price + '\'' + + '}'); + } +} diff --git a/web/WEB-INF/view/showNewType.jsp b/web/WEB-INF/view/showNewType.jsp new file mode 100644 index 0000000..88de6a3 --- /dev/null +++ b/web/WEB-INF/view/showNewType.jsp @@ -0,0 +1,15 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + +
+ +