保存进度!

This commit is contained in:
2023-01-30 18:02:13 +08:00
parent e2486d497f
commit b952cf7b99
55 changed files with 17 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
{
"java.configuration.updateBuildConfiguration": "automatic",
"java.compile.nullAnalysis.mode": "automatic"
}

View File

@@ -0,0 +1,110 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.cpic.xim</groupId>
<artifactId>requirement</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>requirement Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-webmvc -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>5.3.24</version>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc8</artifactId>
<version>19.3.0.0.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>2.0.1.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>7.0.1.Final</version>
</dependency>
<!-- jackson -->
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.13.4</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.13.4</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-annotations -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.13.4</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.11.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-fileupload/commons-fileupload -->
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.4</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.annotation/javax.annotation-api -->
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
</dependency>
</dependencies>
<build>
<finalName>requirement</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M6</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
</project>

View File

@@ -0,0 +1,42 @@
/*
* @Author: Kane
* @Date: 2023-01-29 13:59:37
* @LastEditors: Kane
* @LastEditTime: 2023-01-29 17:10:18
* @FilePath: \requirement\src\main\java\com\cpic\xim\web\controllers\requirements\RequirementController.java
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
package com.cpic.xim.web.controllers.requirements;
import java.io.IOException;
import java.nio.channels.IllegalSelectorException;
import java.sql.SQLException;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.cpic.xim.web.controllers.requirements.param.*;
import com.cpic.xim.web.controllers.requirements.response.*;
@SuppressWarnings( "unused" )
@Controller
public class RequirementController
{
@RequestMapping( "/query_requirements.do" )
@ResponseBody
public RequirementQueryResult queryRequirements( @RequestBody RequirementQueryParam param )
{
RequirementQueryResult result = new RequirementQueryResult();
result.setSuccess( true );
return result;
}
}

View File

@@ -0,0 +1,97 @@
/*
* @Author: Kane
* @Date: 2023-01-29 15:45:00
* @LastEditors: Kane
* @LastEditTime: 2023-01-29 16:04:48
* @FilePath: \requirement\src\main\java\com\cpic\xim\web\controllers\requirements\param\RequirementQueryParam.java
* @Description: 查询需求用的参数对象从JSON转换而来。
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
package com.cpic.xim.web.controllers.requirements.param;
import com.fasterxml.jackson.annotation.JsonProperty;
public final class RequirementQueryParam
{
public RequirementQueryParam()
{}
public String getTitle()
{
return title;
}
public void setTitle( String title )
{
this.title = title;
}
public String getSerial_no()
{
return serial_no;
}
public void setSerial_no( String serial_no )
{
this.serial_no = serial_no;
}
public String getRequest_people()
{
return request_people;
}
public void setRequest_people( String request_people )
{
this.request_people = request_people;
}
public String getStatus()
{
return status;
}
public void setStatus( String status )
{
this.status = status;
}
public String getCommit_start_date()
{
return commit_start_date;
}
public void setCommit_start_date( String commit_start_date )
{
this.commit_start_date = commit_start_date;
}
public String getCommit_end_date()
{
return commit_end_date;
}
public void setCommit_end_date( String commit_end_date )
{
this.commit_end_date = commit_end_date;
}
@JsonProperty( "title")
private String title;
@JsonProperty( "serial_no")
private String serial_no;
@JsonProperty( "request_people")
private String request_people;
@JsonProperty( "status")
private String status;
@JsonProperty( "commit_start_date")
private String commit_start_date;
@JsonProperty( "commit_end_date")
private String commit_end_date;
}

View File

@@ -0,0 +1,45 @@
/*
* @Author: Kane
* @Date: 2023-01-29 16:20:29
* @LastEditors: Kane
* @LastEditTime: 2023-01-29 17:09:59
* @FilePath: \requirement\src\main\java\com\cpic\xim\web\controllers\requirements\response\RequirementQueryResult.java
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
package com.cpic.xim.web.controllers.requirements.response;
import com.fasterxml.jackson.annotation.JsonProperty;
public final class RequirementQueryResult
{
public RequirementQueryResult()
{}
public boolean getSuccess()
{
return success;
}
public void setSuccess( boolean success )
{
this.success = success;
}
public String getMessage()
{
return message;
}
public void setMessage( String message )
{
this.message = message;
}
@JsonProperty( "success" )
private boolean success;
@JsonProperty( "message" )
private String message;
}

View File

@@ -0,0 +1,43 @@
/*
* @Author: Kane
* @Date: 2023-01-29 10:39:41
* @LastEditors: Kane
* @LastEditTime: 2023-01-29 10:39:44
* @FilePath: \requirement\src\main\java\com\cpic\xim\web\filters\cros\CrosFilter.java
* @Description: 过滤器用于对CROS访问进行响应。允许任何来源的访问。
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
package com.cpic.xim.web.filters.cros;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class CrosFilter implements Filter
{
@Override
public void doFilter( ServletRequest req, ServletResponse resp, FilterChain chain )
throws ServletException, IOException
{
HttpServletRequest request = (HttpServletRequest) req;
HttpServletResponse response = (HttpServletResponse) resp;
String originHeader = request.getHeader( "Origin" );
response.setHeader( "Access-Control-Allow-Origin", originHeader );
response.setHeader( "Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE" );
response.setHeader( "Access-Control-Max-Age", "0" );
response.setHeader( "Access-Control-Allow-Headers",
"Origin, No-Cache, X-Requested-With, If-Modified-Since, Pragma, Last-Modified, Cache-Control, Expires, Content-Type, X-E4M-With,userId,token" );
response.setHeader( "Access-Control-Allow-Credentials", "true" );
response.setHeader( "XDomainRequestAllowed", "1" );
response.setHeader( "XDomainRequestAllowed", "1" );
chain.doFilter( request, response );
}
}

View File

@@ -0,0 +1,37 @@
/*
* @Author: Kane
* @Date: 2023-01-29 10:50:49
* @LastEditors: Kane
* @LastEditTime: 2023-01-29 10:55:27
* @FilePath: \requirement\src\main\java\com\cpic\xim\web\filters\token\TokenFilter.java
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
package com.cpic.xim.web.filters.token;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@SuppressWarnings( "unused")
public class TokenFilter implements Filter
{
@Override
public void doFilter( ServletRequest req, ServletResponse resp, FilterChain chain )
throws ServletException, IOException
{
HttpServletRequest request = (HttpServletRequest) req;
HttpServletResponse response = (HttpServletResponse) resp;
// 获取请求中的token字符串
String token = request.getHeader( "Token" );
chain.doFilter( request, response );
}
}

View File

@@ -0,0 +1,37 @@
<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:jdbc="http://www.springframework.org/schema/jdbc"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:jpa="http://www.springframework.org/schema/data/jpa"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.2.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.2.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa-1.3.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.2.xsd">
<context:component-scan base-package="com.cpic.xim" />
<mvc:annotation-driven />
<mvc:default-servlet-handler />
<!-- <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property
name="prefix" value="/WEB-INF/jsp/" />
<property name="suffix" value=".jsp" />
</bean> -->
<bean id="multipartResolver"
class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<property name="defaultEncoding" value="UTF-8" />
<property name="maxUploadSize" value="-1" />
</bean>
</beans>

View File

@@ -0,0 +1,39 @@
<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_3_1.xsd"
version="3.1">
<display-name>Archetype Created Web Application</display-name>
<servlet>
<servlet-name>springmvc</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springmvc</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<filter>
<filter-name>CrosFilter</filter-name>
<filter-class>com.cpic.xim.web.filters.cros.CrosFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>CrosFilter</filter-name>
<url-pattern>*</url-pattern>
</filter-mapping>
<filter>
<filter-name>TokenFilter</filter-name>
<filter-class>com.cpic.xim.web.filters.token.TokenFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>TokenFilter</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
</web-app>

View File

@@ -0,0 +1,5 @@
<html>
<body>
<h2>Hello World!</h2>
</body>
</html>

View File

@@ -0,0 +1,4 @@
#Created by Apache Maven 3.8.6
artifactId=requirement
groupId=com.cpic.xim
version=1.0-SNAPSHOT

View File

@@ -0,0 +1,5 @@
com\cpic\xim\web\controllers\requirements\response\RequirementQueryResult.class
com\cpic\xim\web\filters\token\TokenFilter.class
com\cpic\xim\web\controllers\requirements\param\RequirementQueryParam.class
com\cpic\xim\web\filters\cros\CrosFilter.class
com\cpic\xim\web\controllers\requirements\RequirementController.class

View File

@@ -0,0 +1,5 @@
D:\develop\cpicxim\it-console\code\java\requirement\src\main\java\com\cpic\xim\web\controllers\requirements\RequirementController.java
D:\develop\cpicxim\it-console\code\java\requirement\src\main\java\com\cpic\xim\web\filters\cros\CrosFilter.java
D:\develop\cpicxim\it-console\code\java\requirement\src\main\java\com\cpic\xim\web\controllers\requirements\param\RequirementQueryParam.java
D:\develop\cpicxim\it-console\code\java\requirement\src\main\java\com\cpic\xim\web\controllers\requirements\response\RequirementQueryResult.java
D:\develop\cpicxim\it-console\code\java\requirement\src\main\java\com\cpic\xim\web\filters\token\TokenFilter.java

View File

@@ -0,0 +1,37 @@
<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:jdbc="http://www.springframework.org/schema/jdbc"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:jpa="http://www.springframework.org/schema/data/jpa"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.2.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.2.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa-1.3.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.2.xsd">
<context:component-scan base-package="com.cpic.xim" />
<mvc:annotation-driven />
<mvc:default-servlet-handler />
<!-- <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property
name="prefix" value="/WEB-INF/jsp/" />
<property name="suffix" value=".jsp" />
</bean> -->
<bean id="multipartResolver"
class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<property name="defaultEncoding" value="UTF-8" />
<property name="maxUploadSize" value="-1" />
</bean>
</beans>

View File

@@ -0,0 +1,39 @@
<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_3_1.xsd"
version="3.1">
<display-name>Archetype Created Web Application</display-name>
<servlet>
<servlet-name>springmvc</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springmvc</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<filter>
<filter-name>CrosFilter</filter-name>
<filter-class>com.cpic.xim.web.filters.cros.CrosFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>CrosFilter</filter-name>
<url-pattern>*</url-pattern>
</filter-mapping>
<filter>
<filter-name>TokenFilter</filter-name>
<filter-class>com.cpic.xim.web.filters.token.TokenFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>TokenFilter</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
</web-app>

View File

@@ -0,0 +1,5 @@
<html>
<body>
<h2>Hello World!</h2>
</body>
</html>