提交停车信息类,并使其前台信息传至后台

main
17303970672 5 months ago
parent a9f3a87f9b
commit 35ecc54e3f

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

@ -0,0 +1,58 @@
package com.ssm.entity;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
public class TingchexinxiModel {
// 停车ID
private Integer parkingId;
// 车牌号
private String licensePlate;
// 进入时间
private String entryTime;
// 离开时间
private String exitTime;
public Integer getParkingId() {
return parkingId;
}
public void setParkingId(Integer parkingId) {
this.parkingId = parkingId;
}
public String getLicensePlate() {
return licensePlate;
}
public void setLicensePlate(String licensePlate) {
this.licensePlate = licensePlate;
}
public String getEntryTime() {
return entryTime;
}
public void setEntryTime(String entryTime) {
this.entryTime = entryTime;
}
public String getExitTime() {
return exitTime;
}
public void setExitTime(String exitTime) {
this.exitTime = exitTime;
}
@Override
public String toString() {
return "TingchexinxiModel{" +
"停车ID=" + parkingId +
", 车牌号='" + licensePlate + '\'' +
", 进入时间=" + entryTime +
", 离开时间=" + exitTime +
'}';
}
}

@ -0,0 +1,18 @@
<%--
Created by IntelliJ IDEA.
User: 吴
Date: 2025/3/31
Time: 21:42
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>Title</title>
</head>
<body>
success
<br>
停车信息已在控制台输出!
</body>
</html>

@ -0,0 +1,46 @@
<%--
Created by IntelliJ IDEA.
User: 吴
Date: 2025/3/31
Time: 21:43
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>Title</title>
</head>
<body>
<form action="tingchexinxi/add" method="post">
<table>
<tr>
<td>停车ID</td>
<td width="20"></td>
<td><input type="text" name="parkingId" placeholder="请输入停车ID" /></td>
</tr>
<tr>
<td>车牌号:</td>
<td width="20"></td>
<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="添加">
</td>
</tr>
</table>
</form>
</body>
</html>
Loading…
Cancel
Save