# Conflicts:
#	src/com/ssm/controller/TingchexinxiController.java
#	src/com/ssm/entity/TingchexinxiModel.java
#	web/WEB-INF/view/showNewType.jsp
#	web/WEB-INF/view/showTingchexinxi.jsp
#	web/addNewType.jsp
#	web/addTingchexinxi.jsp
main
张梓瑞 5 months ago
commit 9fe3208671

@ -1,15 +1,16 @@
package com.ssm.controller; package com.ssm.controller;
import com.ssm.entity.NewTypeModel;
import com.ssm.entity.TingchexinxiModel; import com.ssm.entity.TingchexinxiModel;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@Controller @Controller
@RequestMapping("tingchexinxi") @RequestMapping("tingchexinxi")
public class TingchexinxiController { public class TingchexinxiController {
@RequestMapping("addtingchexinxi") @RequestMapping("add")
public String test(TingchexinxiModel tingchexinxiModel) { public String test(TingchexinxiModel tingchexinxi) {
System.out.println("停车车位信息" + tingchexinxiModel.toString()); System.out.println("停车信息" + tingchexinxi.toString());
return "showTingchexinxi"; return "showTingchexinxi";
} }
} }

@ -0,0 +1,18 @@
package com.ssm.controller;
import com.ssm.entity.UserModel;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@RequestMapping("user")
public class UserController {
@RequestMapping("add")
public String useradd(UserModel user) {
System.out.println("车主id" + user.getUserid());
System.out.println("车主名字:" + user.getUsername());
System.out.println("密码:" + user.getUserpw());
System.out.println("车主电话:" + user.getUserphone());
return "showUser";
}
}

@ -1,66 +1,58 @@
package com.ssm.entity; package com.ssm.entity;
import org.springframework.beans.factory.annotation.Value; import org.springframework.format.annotation.DateTimeFormat;
public class TingchexinxiModel { import java.util.Date;
// 车位编号
private String spaceNumber;
// 车位所在区域
private String area;
// 车位类型(普通车位、残疾人车位)
private String spaceType;
public String getSpaceNumber() {
return spaceNumber;
}
public void setSpaceNumber(String spaceNumber) { public class TingchexinxiModel {
this.spaceNumber = spaceNumber; // 停车ID
} private Integer parkingId;
// 车牌号
private String licensePlate;
// 进入时间
private String entryTime;
// 离开时间
private String exitTime;
public String getArea() { public Integer getParkingId() {
return area; return parkingId;
} }
public void setArea(String area) { public void setParkingId(Integer parkingId) {
this.area = area; this.parkingId = parkingId;
} }
public String getSpaceType() { public String getLicensePlate() {
return spaceType; return licensePlate;
} }
public void setSpaceType(String spaceType) { public void setLicensePlate(String licensePlate) {
this.spaceType = spaceType; this.licensePlate = licensePlate;
} }
public String getStatus() { public String getEntryTime() {
return status; return entryTime;
} }
public void setStatus(String status) { public void setEntryTime(String entryTime) {
this.status = status; this.entryTime = entryTime;
} }
public double getPrice() { public String getExitTime() {
return price; return exitTime;
} }
public void setPrice(double price) { public void setExitTime(String exitTime) {
this.price = price; this.exitTime = exitTime;
} }
// 车位状态(空闲、已占用) @Override
private String status; public String toString() {
// 车位价格 return "TingchexinxiModel{" +
private double price; "停车ID=" + parkingId +
public void printInfo() { ", 车牌号='" + licensePlate + '\'' +
System.out.println("ParkingLotSpace{" + ", 进入时间=" + entryTime +
"车位编号=" + spaceNumber + ", 离开时间=" + exitTime +
", 车位所在区域='" + area + '\'' + '}';
", 车位类型='" + spaceType + '\'' +
", 车位状态='" + status + '\'' +
", 车位价格='" + price + '\'' +
'}');
} }
} }

@ -0,0 +1,41 @@
package com.ssm.entity;
public class UserModel {
private int userid;//用户id
private String username;//用户名
private int userpw;//用户密码
private int userphone;//用户电话
public int getUserid() {
return userid;
}
public void setUserid(int userid) {
this.userid = userid;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public int getUserpw() {
return userpw;
}
public void setUserpw(int userpw) {
this.userpw = userpw;
}
public int getUserphone() {
return userphone;
}
public void setUserphone(int userphone) {
this.userphone = userphone;
}
}

@ -3,11 +3,14 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context" xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/tool http://www.springframework.org/schema/tool/spring-tool.xsd http://www.springframework.org/schema/mvc https://www.springframework.org/schema/mvc/spring-mvc.xsd"> http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/mvc
https://www.springframework.org/schema/mvc/spring-mvc.xsd">
<!-- 配置注解扫描器配置spring容器初始化对象时需要扫描的包 --> <!-- 配置注解扫描器配置spring容器初始化对象时需要扫描的包 -->
<context:component-scan base-package="com.ssm.controller"></context:component-scan> <context:component-scan base-package="com.ssm.controller"/>
<!-- 配置视图解析器,ctrl+shift+t搜索类将return的字符串逻辑视图+前缀+后缀,转换成真正的物理视图 --> <!-- 配置视图解析器,ctrl+shift+t搜索类将return的字符串逻辑视图+前缀+后缀,转换成真正的物理视图 -->
<!-- 逻辑视图success,真正的视图:/WEB-INF/view/success.jsp --> <!-- 逻辑视图success,真正的视图:/WEB-INF/view/success.jsp -->
<!-- --> <!-- -->
@ -15,9 +18,9 @@
<mvc:annotation-driven/> <mvc:annotation-driven/>
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<!-- 前缀 --> <!-- 前缀 -->
<property name="prefix" value="/WEB-INF/view/"></property> <property name="prefix" value="/WEB-INF/view/"/>
<!-- 后缀 --> <!-- 后缀 -->
<property name="suffix" value=".jsp"></property> <property name="suffix" value=".jsp"/>
</bean> </bean>
<bean class="org.springframework.format.support.FormattingConversionServiceFactoryBean"> <bean class="org.springframework.format.support.FormattingConversionServiceFactoryBean">

@ -11,5 +11,4 @@ success
<br> <br>
新闻类型信息已在控制台输出! 新闻类型信息已在控制台输出!
</body> </body>
</body>
</html> </html>

@ -1,20 +1,18 @@
<%-- <%--
Created by IntelliJ IDEA. Created by IntelliJ IDEA.
User: user User:
Date: 2025/3/26 Date: 2025/3/31
Time: 9:42 Time: 21:42
To change this template use File | Settings | File Templates. To change this template use File | Settings | File Templates.
--%> --%>
<%@ page language="java" contentType="text/html; charset=UTF-8" <%@ page contentType="text/html;charset=UTF-8" language="java" %>
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html> <html>
<head> <head>
<title>Title</title> <title>Title</title>
</head> </head>
<body> <body>
Success! success
<br> <br>
停车车位信息已在控制台输出! 停车信息已在控制台输出!
</body> </body>
</html> </html>

@ -0,0 +1,11 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>展示userController接收及响应数据</title>
</head>
<body>
success
<br>
车主信息已在控制台输出!
</body>
</html>

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1"> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
<display-name>SpringMVCFirst</display-name> <display-name>SpringMVCFirst</display-name>
<welcome-file-list> <welcome-file-list>
<welcome-file>index.html</welcome-file> <welcome-file>index.html</welcome-file>

@ -1,10 +1,3 @@
<%--
Created by IntelliJ IDEA.
User: 吴彦祖
Date: 2025/3/26
Time: 16:31
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html> <html>
<head> <head>

@ -1,28 +1,46 @@
<%-- <%--
Created by IntelliJ IDEA. Created by IntelliJ IDEA.
User: user User:
Date: 2025/3/26 Date: 2025/3/31
Time: 9:41 Time: 21:43
To change this template use File | Settings | File Templates. To change this template use File | Settings | File Templates.
--%> --%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html> <html>
<head> <head>
<title>停车车位信息</title> <title>Title</title>
</head> </head>
<body> <body>
<form action="tingchexinxi/addtingchexinxi" method="post"> <form action="tingchexinxi/add" method="post">
车位编号:<input type="text" name="spaceNumber"> <table>
<br> <tr>
区域名称:<input type="text" name="area"> <td>停车ID</td>
<br> <td width="20"></td>
车位价格:<input type="text" name="price"> <td><input type="text" name="parkingId" placeholder="请输入停车ID" /></td>
<br> </tr>
车位状态:<input type="text" name="status"> <tr>
<br> <td>车牌号:</td>
车位类型:<input type="text" name="spaceType"> <td width="20"></td>
<br> <td><input type="text" name="licensePlate" placeholder="请输入车牌号" /></td>
</tr>
<tr>
<td>进入时间:</td>
<td width="20"></td>
<td><input type="text" name="entryTime" placeholder="请输入进入时间" /></td>
</tr>
<tr>
<td>离开时间:</td>
<td width="20"></td>
<td><input type="text" name="exitTime" placeholder="请输入离开时间" /></td>
</tr>
<tr>
<td align="right"><input type="reset" value="重置"></td>
<td></td>
<td align="center">
<input type="submit" value="添加"> <input type="submit" value="添加">
</td>
</tr>
</table>
</form> </form>
</body> </body>
</html> </html>

@ -0,0 +1,36 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>添加用户类型</title>
</head>
<body>
<form action="user/add" method="post">
<table>
<tr>
<td>车主id</td>
<td width="20"></td>
<td><input type="text" name="userid" placeholder="请输入用户id" /></td>
</tr>
<tr>
<td>车主名:</td>
<td width="20"></td>
<td><input type="text" name="username" placeholder="请输入用户名" /></td>
</tr>
<tr>
<td>密码:</td>
<td width="20"></td>
<td><input type="password" name="user_password" placeholder="请输入密码" /></td>
</tr>
<tr>
<td>车主电话:</td>
<td width="20"></td>
<td><input type="text" name="user_phone" placeholder="请输入用户电话" /></td>
</tr>
<tr>
<td align="right"><input type="reset" value="重置"></td>
<td align="center"><input type="submit" value="添加"></td>
</tr>
</table>
</form>
</body>
</html>
Loading…
Cancel
Save