编写了停车场系统的mvc框架

main
ZMJ 2 months ago
parent 6eb5685873
commit 779b7b2d5c

8
.idea/.gitignore vendored

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

@ -0,0 +1,13 @@
<component name="ArtifactManager">
<artifact type="exploded-war" name="parkingmanagement-SpringMVCProject-2205:Web exploded">
<output-path>$PROJECT_DIR$/out/artifacts/parkingmanagement_SpringMVCProject_2205_Web_exploded</output-path>
<root id="root">
<element id="javaee-facet-resources" facet="parkingmanagement-SpringMVCProject-2205/web/Web" />
<element id="directory" name="WEB-INF">
<element id="directory" name="classes">
<element id="module-output" name="parkingmanagement-SpringMVCProject-2205" />
</element>
</element>
</root>
</artifact>
</component>

@ -0,0 +1,17 @@
<component name="ArtifactManager">
<artifact type="exploded-war" name="parkingmanagement-SpringMVCProject-2205:war exploded">
<output-path>$PROJECT_DIR$/out/artifacts/parkingmanagement_SpringMVCProject_2205_war_exploded</output-path>
<root id="root">
<element id="directory" name="WEB-INF">
<element id="directory" name="classes">
<element id="module-output" name="parkingmanagement-SpringMVCProject-2205" />
</element>
<element id="directory" name="lib">
<element id="library" level="project" name="commons-logging-1.1.1" />
</element>
</element>
<element id="library" level="project" name="lib" />
<element id="javaee-facet-resources" facet="parkingmanagement-SpringMVCProject-2205/web/Web" />
</root>
</artifact>
</component>

@ -0,0 +1,16 @@
<component name="libraryTable">
<library name="commons-logging-1.1.1">
<CLASSES>
<root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/commons-logging-1.1.1.jar!/" />
<root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/spring-aop-5.1.6.RELEASE.jar!/" />
<root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/spring-beans-5.1.6.RELEASE.jar!/" />
<root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/spring-context-5.1.6.RELEASE.jar!/" />
<root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/spring-core-5.1.6.RELEASE.jar!/" />
<root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/spring-expression-5.1.6.RELEASE.jar!/" />
<root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/spring-web-5.1.6.RELEASE.jar!/" />
<root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/spring-webmvc-5.1.6.RELEASE.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

@ -0,0 +1,18 @@
<component name="libraryTable">
<library name="lib">
<CLASSES>
<root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/servlet-api.jar!/" />
<root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/jsp-api.jar!/" />
<root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/spring-aop-5.3.9.jar!/" />
<root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/spring-beans-5.3.9.jar!/" />
<root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/spring-web-5.3.9.jar!/" />
<root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/spring-core-5.3.9.jar!/" />
<root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/commons-logging-1.2.jar!/" />
<root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/spring-expression-5.3.9.jar!/" />
<root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/spring-context-5.3.9.jar!/" />
<root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/spring-webmvc-5.3.9.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="corretto-1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/parkingmanagement-SpringMVCProject-2205.iml" filepath="$PROJECT_DIR$/parkingmanagement-SpringMVCProject-2205.iml" />
</modules>
</component>
</project>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<!--配置扫描注解包-->
<context:component-scan base-package="com.ssm.controller"/>
<!--配置视图解析器-->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<!--配置了一个前缀-->
<property name="prefix" value="/WEB-INF/view/"></property>
<!--配置了一个后缀-->
<property name="suffix" value=".jsp"></property>
</bean>
</beans>

@ -0,0 +1,16 @@
<%--
Created by IntelliJ IDEA.
User: burial
Date: 2025/3/27
Time: 17:28
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>入门程序</title>
</head>
<body>
success!
</body>
</html>

@ -0,0 +1,20 @@
<%--
Created by IntelliJ IDEA.
User: burial
Date: 2025/3/29
Time: 18:21
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>
<h1>Success!</h1>
入场时间:${information.imRuchang}<br>
出场时间:${information.imChuchang}<br>
停车时长:${information.imShichang}<br>
停车费用:${information.imFeiyong}<br>
</body>
</html>

@ -0,0 +1,20 @@
<%--
Created by IntelliJ IDEA.
User: burial
Date: 2025/3/29
Time: 18:21
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>
<h1>Success!</h1>
用户名:${news.nsLeibie}<br>
性别:${news.nsTime}<br>
手机号:${news.nsLaiyuan}<br>
车牌号:${news.nsZuozhe}<br>
</body>
</html>

@ -0,0 +1,20 @@
<%--
Created by IntelliJ IDEA.
User: burial
Date: 2025/3/29
Time: 18:21
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>
<h1>Success!</h1>
空余车位:${parkingSpot.rsKongyu}<br>
预约时间:${parkingSpot.rsTime}<br>
订单状态:${parkingSpot.rsDingdan}<br>
支付方式:${parkingSpot.rsZhifu}<br>
</body>
</html>

@ -0,0 +1,21 @@
<%--
Created by IntelliJ IDEA.
User: 86180
Date: 2025/3/30
Time: 10:58
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>
<h1>Success!</h1>
停车区域:${tingche.teQuyu}<br>
停车地点:${tingche.teDidian}<br>
负责人:${tingche.teFuzeren}<br>
停车状态:${tingche.teZhuangtai}<br>
<h1>停车管理已在控制台输出!</h1>
</body>
</html>

@ -0,0 +1,20 @@
<%--
Created by IntelliJ IDEA.
User: burial
Date: 2025/3/29
Time: 18:21
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>
<h1>Success!</h1>
用户名:${user.urName}<br>
性别:${user.urSex}<br>
手机号:${user.urPhone}<br>
车牌号:${user.urPlate}<br>
</body>
</html>

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0">
<servlet>
<servlet-name>DispatcherServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<!--配置DispatcherServlet前端控制器的初始化参数-->
<init-param>
<!--配置SpringMVC配置文件的路径-->
<param-name>contextConfigLocation</param-name>
<param-value>classpath:springmvc.xml</param-value>
</init-param>
<!--配置DispatcherServlet的创建时刻是在Web工程启动时创建而不是在调用时创建-->
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>DispatcherServlet</servlet-name>
<!--/代表所有请求-->
<url-pattern>/</url-pattern>
</servlet-mapping>
<!--字符编码过滤器-->
<filter>
<filter-name>characterEncodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>characterEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>

@ -0,0 +1,44 @@
<%--
Created by IntelliJ IDEA.
User: T430
Date: 2025/3/30
Time: 1:11
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="news/newnews" method="post">
<table>
<tr>
<td>姓名:</td>
<td width="20"></td>
<td><input type="text" name="nsLeibie" placeholder="请输入新闻类别"></td>
</tr>
<tr>
<td>性别:</td>
<td width="20"></td>
<td><input type="text" name="nsTime" placeholder="请输入发布时间"></td>
</tr>
<tr>
<td>手机号:</td>
<td width="20"></td>
<td><input type="text" name="nsLaiyuan" placeholder="请输入新闻来源"></td>
</tr>
<tr>
<td>车牌号:</td>
<td width="20"></td>
<td><input type="text" name="nsZuozhe" placeholder="请输入新闻作者"></td>
</tr>
<tr>
<td></td>
<td width="20"></td>
<td><input type="submit" value="提交"></td>
</tr>
</table>
</form>
</body>
</html>

@ -0,0 +1,44 @@
<%--
Created by IntelliJ IDEA.
User: LENOVO
Date: 2025/3/29
Time: 23:41
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="information/newinformation1" method="post">
<table>
<tr>
<td>姓名:</td>
<td width="20"></td>
<td><input type="text" name="imRuchang" placeholder="请输入入场时间"></td>
</tr>
<tr>
<td>性别:</td>
<td width="20"></td>
<td><input type="text" name="imChuchang" placeholder="请输入出场时间"></td>
</tr>
<tr>
<td>手机号:</td>
<td width="20"></td>
<td><input type="text" name="imShichang" placeholder="请输入停车时长"></td>
</tr>
<tr>
<td>车牌号:</td>
<td width="20"></td>
<td><input type="text" name="imFeiyong" placeholder="请输入停车费用"></td>
</tr>
<tr>
<td></td>
<td width="20"></td>
<td><input type="submit" value="提交"></td>
</tr>
</table>
</form>
</body>
</html>

@ -0,0 +1,44 @@
<%--
Created by IntelliJ IDEA.
User: guo'jia'yao
Date: 2025/3/30
Time: 8:41
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="parkingSpot/parkingSpot" method="post">
<table>
<tr>
<td>空余车位:</td>
<td width="20"></td>
<td><input type="text" name="rsKongyu" placeholder="请输入空余车位"></td>
</tr>
<tr>
<td>预约时间:</td>
<td width="20"></td>
<td><input type="text" name="rsTime" placeholder="请输入预约时间"></td>
</tr>
<tr>
<td>订单状态:</td>
<td width="20"></td>
<td><input type="text" name="rsDingdan" placeholder="请输入订单状态"></td>
</tr>
<tr>
<td>支付方式:</td>
<td width="20"></td>
<td><input type="text" name="rsZhifu" placeholder="请输入支付方式"></td>
</tr>
<tr>
<td></td>
<td width="20"></td>
<td><input type="submit" value="提交"></td>
</tr>
</table>
</form>
</body>
</html>

@ -0,0 +1,44 @@
<%--
Created by IntelliJ IDEA.
User: 86180
Date: 2025/3/30
Time: 10:56
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="tingche/newtingche1" method="post">
<table>
<tr>
<td>名称:</td>
<td width="20"></td>
<td><input type="text" name="teQuyu" placeholder="请输入区域名称"></td>
</tr>
<tr>
<td>地点:</td>
<td width="20"></td>
<td><input type="text" name="teDidian" placeholder="请输入区域地点"></td>
</tr>
<tr>
<td>负责人:</td>
<td width="20"></td>
<td><input type="text" name="teFuzeren" placeholder="请输入区域负责人"></td>
</tr>
<tr>
<td>车牌号:</td>
<td width="20"></td>
<td><input type="text" name="teZhuangtai" placeholder="请输入区域状态"></td>
</tr>
<tr>
<td></td>
<td width="20"></td>
<td><input type="submit" value="提交"></td>
</tr>
</table>
</form>
</body>
</html>

@ -0,0 +1,44 @@
<%--
Created by IntelliJ IDEA.
User: burial
Date: 2025/3/29
Time: 18: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="user/newuser1" method="post">
<table>
<tr>
<td>姓名:</td>
<td width="20"></td>
<td><input type="text" name="urName" placeholder="请输入姓名"></td>
</tr>
<tr>
<td>性别:</td>
<td width="20"></td>
<td><input type="text" name="urSex" placeholder="请输入性别"></td>
</tr>
<tr>
<td>手机号:</td>
<td width="20"></td>
<td><input type="text" name="urPhone" placeholder="请输入手机号"></td>
</tr>
<tr>
<td>车牌号:</td>
<td width="20"></td>
<td><input type="text" name="urPlate" placeholder="请输入车牌号"></td>
</tr>
<tr>
<td></td>
<td width="20"></td>
<td><input type="submit" value="提交"></td>
</tr>
</table>
</form>
</body>
</html>

@ -0,0 +1,16 @@
<%--
Created by IntelliJ IDEA.
User: burial
Date: 2025/3/27
Time: 17:23
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>入门程序</title>
</head>
<body>
<a href="hello">hello word</a>
</body>
</html>

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<!--配置扫描注解包-->
<context:component-scan base-package="com.ssm.controller"/>
<!--配置视图解析器-->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<!--配置了一个前缀-->
<property name="prefix" value="/WEB-INF/view/"></property>
<!--配置了一个后缀-->
<property name="suffix" value=".jsp"></property>
</bean>
</beans>

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="web" name="Web">
<configuration>
<descriptors>
<deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/web/WEB-INF/web.xml" />
</descriptors>
<webroots>
<root url="file://$MODULE_DIR$/web" relative="/" />
</webroots>
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="lib" level="project" />
<orderEntry type="library" name="commons-logging-1.1.1" level="project" />
</component>
</module>

@ -2,12 +2,11 @@ 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";
}
@RequestMapping("hello")
public String hello(){
return "showFirst";
}
}

@ -0,0 +1,26 @@
package com.ssm.controller;
import com.ssm.entity.Information;
import com.ssm.entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
@Controller
@RequestMapping("information")
public class InformationController {
@RequestMapping("information1")
public String information1(Information information){
System.out.println("用户信息:"+information.toString());
return "showInformation";
}
@RequestMapping("newinformation1")
public ModelAndView InformationController(Information information) {
ModelAndView mv = new ModelAndView("showInformation");
mv.addObject("information", information);
return mv;
}
}

@ -0,0 +1,23 @@
package com.ssm.controller;
import com.ssm.entity.News;
import com.ssm.entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
@Controller
@RequestMapping("news")
public class NewsController {
@RequestMapping("news")
public String news1(News news){
System.out.println("用户信息:"+news.toString());
return "showNews";
}
@RequestMapping("newnews")
public ModelAndView NewsController(News news) {
ModelAndView mv = new ModelAndView("showNews");
mv.addObject("news", news);
return mv;
}
}

@ -0,0 +1,22 @@
package com.ssm.controller;
import com.ssm.entity.ParkingSpot;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
@Controller
@RequestMapping("parkingSpot")
public class ParkingSpotController {
@RequestMapping("parkingSpot")
public String user1(ParkingSpot parkingSpot){
System.out.println("车位预约:"+parkingSpot.toString());
return "showParkingSpot";
}
@RequestMapping("newparkingSpot")
public ModelAndView ParkingSpotController(ParkingSpot parkingSpot) {
ModelAndView mv = new ModelAndView("showParkingSpot");
mv.addObject("parkingSpot", parkingSpot);
return mv;
}
}

@ -0,0 +1,23 @@
package com.ssm.controller;
import com.ssm.entity.Tingche;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
@Controller
@RequestMapping("tingche")
public class TingcheController {
@RequestMapping("tingche1")
public String tingche1(Tingche tingche){
System.out.println("停车关林:");
tingche.printInfo();
return "showTingche";
}
@RequestMapping("newtingche1")
public ModelAndView InformationController(Tingche tingche) {
ModelAndView mv = new ModelAndView("showTingche");
mv.addObject("tingche", tingche);
return mv;
}
}

@ -1,22 +0,0 @@
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;
}
}

@ -0,0 +1,22 @@
package com.ssm.controller;
import com.ssm.entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
@Controller
@RequestMapping("user")
public class UserController {
@RequestMapping("user1")
public String user1(User user){
System.out.println("用户信息:"+user.toString());
return "showUser";
}
@RequestMapping("newuser1")
public ModelAndView UserController(User user) {
ModelAndView mv = new ModelAndView("showUser");
mv.addObject("user", user);
return mv;
}
}

@ -1,18 +0,0 @@
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";
}
}

@ -0,0 +1,53 @@
package com.ssm.entity;
public class Information {
//入场时间
private String imRuchang;
//出场时间
private String imChuchang;
//停车时长
private String imShichang;
//停车费用
private String imFeiyong;
public String getImRuchang() {
return imRuchang;
}
public void setImRuchang(String imRuchang) {
this.imRuchang = imRuchang;
}
public String getImChuchang() {
return imChuchang;
}
public void setImChuchang(String imChuchang) {
this.imChuchang = imChuchang;
}
public String getImShichang() {
return imShichang;
}
public void setImShichang(String imShichang) {
this.imShichang = imShichang;
}
public String getImFeiyong() {
return imFeiyong;
}
public void setImFeiyong(String imFeiyong) {
this.imFeiyong = imFeiyong;
}
@Override
public String toString() {
return "User{" +
"urName='" + imRuchang + '\'' +
", urSex='" + imChuchang + '\'' +
", urPhone='" + imShichang + '\'' +
", urPlate='" + imFeiyong + '\'' +
'}';
}
}

@ -0,0 +1,54 @@
package com.ssm.entity;
public class News {
//新闻类别
private String nsLeibie;
//发布时间
private String nsTime;
//新闻来源
private String nsLaiyuan;
//新闻作者
private String nsZuozhe;
public String getNsLeibie() {
return nsLeibie;
}
public void setNsLeibie(String nsLeibie) {
this.nsLeibie = nsLeibie;
}
public String getNsTime() {
return nsTime;
}
public void setNsTime(String nsTime) {
this.nsTime = nsTime;
}
public String getNsZuozhe() {
return nsZuozhe;
}
public void setNsZuozhe(String nsZuozhe) {
this.nsZuozhe = nsZuozhe;
}
public String getNsLaiyuan() {
return nsLaiyuan;
}
public void setNsLaiyuan(String nsLaiyuan) {
this.nsLaiyuan = nsLaiyuan;
}
@Override
public String toString() {
return "News{" +
"nsLeibie='" + nsLeibie + '\'' +
", nsTime='" + nsTime + '\'' +
", nsLaiyuan='" + nsLaiyuan + '\'' +
", nsZuozhe='" + nsZuozhe + '\'' +
'}';
}
}

@ -0,0 +1,54 @@
package com.ssm.entity;
public class ParkingSpot {
//空余车位
private String rsKongyu;
//预约时间
private String rsTime;
//订单状态
private String rsDingdan;
//支付方式
private String rsZhifu;
public String getRsKongyu() {
return rsKongyu;
}
public void setRsKongyu(String rsKongyu) {
this.rsKongyu = rsKongyu;
}
public String getRsTime() {
return rsTime;
}
public void setRsTime(String rsTime) {
this.rsTime = rsTime;
}
public String getRsDingdan() {
return rsDingdan;
}
public void setRsDingdan(String rsDingdan) {
this.rsDingdan = rsDingdan;
}
public String getRsZhifu() {
return rsZhifu;
}
public void setRsZhifu(String rsZhifu) {
this.rsZhifu = rsZhifu;
}
@Override
public String toString() {
return "ParkingSpot{" +
"rsKongyu='" + rsKongyu + '\'' +
", rsTime='" + rsTime + '\'' +
", rsDingdan='" + rsDingdan + '\'' +
", rsZhifu='" + rsZhifu + '\'' +
'}';
}
}

@ -0,0 +1,48 @@
package com.ssm.entity;
public class Tingche {
//区域名称
private String teQuyu;
//区域地点
private String teDidian;
//区域负责人
private String teFuzeren;
//区域状态
private String teZhuangtai;
public String getTeQuyu() {
return teQuyu;
}
public void setTeQuyu(String teQuyu) {
this.teQuyu = teQuyu;
}
public String getTeDidian() {
return teDidian;
}
public void setTeDidian(String teDidian) {
this.teDidian = teDidian;
}
public String getTeFuzeren() {
return teFuzeren;
}
public void setTeFuzeren(String teFuzeren) {
this.teFuzeren = teFuzeren;
}
public String getTeZhuangtai() {
return teZhuangtai;
}
public void setTeZhuangtai(String teZhuangtai) {
this.teZhuangtai = teZhuangtai;
}
public void printInfo(){
System.out.println("区域名称:"+teQuyu+"\n区域地点:"+teDidian+"\n区域负责人:"+teFuzeren+"\n区域状态:"+teZhuangtai);
}
}

@ -1,129 +0,0 @@
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;
}
}

@ -0,0 +1,54 @@
package com.ssm.entity;
public class User {
//姓名
private String urName;
//性别
private String urSex;
//手机号
private String urPhone;
//车牌号
private String urPlate;
public String getUrName() {
return urName;
}
public void setUrName(String urName) {
this.urName = urName;
}
public String getUrSex() {
return urSex;
}
public void setUrSex(String urSex) {
this.urSex = urSex;
}
public String getUrPhone() {
return urPhone;
}
public void setUrPhone(String urPhone) {
this.urPhone = urPhone;
}
public String getUrPlate() {
return urPlate;
}
public void setUrPlate(String urPlate) {
this.urPlate = urPlate;
}
@Override
public String toString() {
return "User{" +
"urName='" + urName + '\'' +
", urSex='" + urSex + '\'' +
", urPhone='" + urPhone + '\'' +
", urPlate='" + urPlate + '\'' +
'}';
}
}

@ -1,229 +0,0 @@
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;
}
}

@ -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 +
'}';
}
}

@ -1,25 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<!--配置扫描注解包-->
<context:component-scan base-package="com.ssm.controller"/>
<!--配置视图解析器-->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<!--配置了一个前缀-->
<property name="prefix" value="/WEB-INF/view/"></property>
<!--配置了一个后缀-->
<property name="suffix" value=".jsp"></property>
</bean>
xsi:schemaLocation="http://www.springframework.org/schema/beans 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">
<!-- 配置注解扫描器配置spring容器初始化对象时需要扫描的包 -->
<context:component-scan base-package="com.ssm.controller"></context:component-scan>
<!-- 配置视图解析器,ctrl+shift+t搜索类将return的字符串逻辑视图+前缀+后缀,转换成真正的物理视图 -->
<!-- 逻辑视图success,真正的视图:/WEB-INF/view/success.jsp -->
<!-- -->
<!-- 配置注解驱动 -->
<mvc:annotation-driven/>
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<!-- 前缀 -->
<property name="prefix" value="/WEB-INF/view/"></property>
<!-- 后缀 -->
<property name="suffix" value=".jsp"></property>
</bean>
<bean class="org.springframework.format.support.FormattingConversionServiceFactoryBean">
</bean>
</beans>

Binary file not shown.

Binary file not shown.

@ -1,12 +1,16 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%--
Created by IntelliJ IDEA.
User: burial
Date: 2025/3/27
Time: 17:28
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>展示入门程序信息</title>
<title>入门程序</title>
</head>
<body>
Success!
success!
</body>
</html>
</html>

@ -0,0 +1,20 @@
<%--
Created by IntelliJ IDEA.
User: burial
Date: 2025/3/29
Time: 18:21
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>
<h1>Success!</h1>
入场时间:${information.imRuchang}<br>
出场时间:${information.imChuchang}<br>
停车时长:${information.imShichang}<br>
停车费用:${information.imFeiyong}<br>
</body>
</html>

@ -0,0 +1,20 @@
<%--
Created by IntelliJ IDEA.
User: burial
Date: 2025/3/29
Time: 18:21
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>
<h1>Success!</h1>
用户名:${news.nsLeibie}<br>
性别:${news.nsTime}<br>
手机号:${news.nsLaiyuan}<br>
车牌号:${news.nsZuozhe}<br>
</body>
</html>

@ -0,0 +1,20 @@
<%--
Created by IntelliJ IDEA.
User: burial
Date: 2025/3/29
Time: 18:21
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>
<h1>Success!</h1>
空余车位:${parkingSpot.rsKongyu}<br>
预约时间:${parkingSpot.rsTime}<br>
订单状态:${parkingSpot.rsDingdan}<br>
支付方式:${parkingSpot.rsZhifu}<br>
</body>
</html>

@ -0,0 +1,21 @@
<%--
Created by IntelliJ IDEA.
User: 86180
Date: 2025/3/30
Time: 10:58
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>
<h1>Success!</h1>
停车区域:${tingche.teQuyu}<br>
停车地点:${tingche.teDidian}<br>
负责人:${tingche.teFuzeren}<br>
停车状态:${tingche.teZhuangtai}<br>
<h1>停车管理已在控制台输出!</h1>
</body>
</html>

@ -1,20 +0,0 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>展示商品分类信息</title>
</head>
<body>
Success!
<br>
区域编号:${tingchequyuInfo.id}
<br>
区域名称:${tingchequyuInfo.tingchequyuName}
<br>
车位数量:${tingchequyuInfo.tingchequyuNumber}
<br>
详情:${tingchequyuInfo.tingchequyuContent}
</body>
</html>

@ -0,0 +1,20 @@
<%--
Created by IntelliJ IDEA.
User: burial
Date: 2025/3/29
Time: 18:21
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>
<h1>Success!</h1>
用户名:${user.urName}<br>
性别:${user.urSex}<br>
手机号:${user.urPhone}<br>
车牌号:${user.urPlate}<br>
</body>
</html>

@ -1,15 +0,0 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>展示Controller接收及响应数据</title>
</head>
<body>
Success!
<br>
车位预约信息已在控制台输出!
</body>
</body>
</html>

@ -1,43 +1,41 @@
<?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">
<display-name>SpringMVCFirst</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>springDispatcherServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<!-- 配置DispatcherServlet的初始化参数 -->
<init-param>
<param-name>contextConfigLocation</param-name>
<!-- 配置SpringMVC配置文件的位置和名称-->
<param-value>classpath:springmvc.xml</param-value>
</init-param>
<!-- 该servlet在第一次加载的时候就被创建而不是等请求时才创建 -->
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springDispatcherServlet</servlet-name>
<!-- 可以应答所有请求 -->
<url-pattern>/</url-pattern>
</servlet-mapping>
<!--编码过滤器,解决中文乱码问题-->
<filter>
<filter-name>characterEncodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>characterEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0">
<servlet>
<servlet-name>DispatcherServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<!--配置DispatcherServlet前端控制器的初始化参数-->
<init-param>
<!--配置SpringMVC配置文件的路径-->
<param-name>contextConfigLocation</param-name>
<param-value>classpath:springmvc.xml</param-value>
</init-param>
<!--配置DispatcherServlet的创建时刻是在Web工程启动时创建而不是在调用时创建-->
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>DispatcherServlet</servlet-name>
<!--/代表所有请求-->
<url-pattern>/</url-pattern>
</servlet-mapping>
<!--字符编码过滤器-->
<filter>
<filter-name>characterEncodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>characterEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>

@ -0,0 +1,44 @@
<%--
Created by IntelliJ IDEA.
User: T430
Date: 2025/3/30
Time: 1:11
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="news/newnews" method="post">
<table>
<tr>
<td>姓名:</td>
<td width="20"></td>
<td><input type="text" name="nsLeibie" placeholder="请输入新闻类别"></td>
</tr>
<tr>
<td>性别:</td>
<td width="20"></td>
<td><input type="text" name="nsTime" placeholder="请输入发布时间"></td>
</tr>
<tr>
<td>手机号:</td>
<td width="20"></td>
<td><input type="text" name="nsLaiyuan" placeholder="请输入新闻来源"></td>
</tr>
<tr>
<td>车牌号:</td>
<td width="20"></td>
<td><input type="text" name="nsZuozhe" placeholder="请输入新闻作者"></td>
</tr>
<tr>
<td></td>
<td width="20"></td>
<td><input type="submit" value="提交"></td>
</tr>
</table>
</form>
</body>
</html>

@ -0,0 +1,44 @@
<%--
Created by IntelliJ IDEA.
User: LENOVO
Date: 2025/3/29
Time: 23:41
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="information/newinformation1" method="post">
<table>
<tr>
<td>姓名:</td>
<td width="20"></td>
<td><input type="text" name="imRuchang" placeholder="请输入入场时间"></td>
</tr>
<tr>
<td>性别:</td>
<td width="20"></td>
<td><input type="text" name="imChuchang" placeholder="请输入出场时间"></td>
</tr>
<tr>
<td>手机号:</td>
<td width="20"></td>
<td><input type="text" name="imShichang" placeholder="请输入停车时长"></td>
</tr>
<tr>
<td>车牌号:</td>
<td width="20"></td>
<td><input type="text" name="imFeiyong" placeholder="请输入停车费用"></td>
</tr>
<tr>
<td></td>
<td width="20"></td>
<td><input type="submit" value="提交"></td>
</tr>
</table>
</form>
</body>
</html>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save