This commit is contained in:
2025-12-29 01:19:33 +08:00
parent 29cca0e4dd
commit 49a8256638
7 changed files with 75 additions and 12 deletions

View File

@@ -16,8 +16,8 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>18</maven.compiler.source>
<maven.compiler.target>18</maven.compiler.target>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<spring.version>6.2.11</spring.version>
<log4j.version>2.25.3</log4j.version>
<jackson.version>2.20.1</jackson.version>

View File

@@ -2,7 +2,7 @@
* @Author: Kane Wang <wangkane@qq.com>
* @Date: 2025-10-31 17:33:13
* @LastEditors: Kane Wang
* @LastModified: 2025-11-27 11:43:18
* @LastModified: 2025-12-26 21:58:32
* @FilePath: src/main/java/com/cpic/xim/utils/files/UploadedFile.java
* @Description:
*
@@ -57,6 +57,9 @@ public class UploadedFile
this.relativeFilePath = relativeFilePath;
}
public UploadedFile()
{}
public UploadedFile( String fileName, String absoluteFilePath, String relativeFilePath )
{
this.fileName = fileName;

View File

@@ -10,12 +10,39 @@
*/
package com.cpic.xim.web.controllers.regulatory;
import java.io.File;
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.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.cpic.xim.utils.files.UploadedFile;
@Controller
@RequestMapping("/regulatory")
public class AddNewRegulatoryController
@RequestMapping( "/regulatory" )
public class AddNewRegulatoryController
{
@RequestMapping( path = "/add-new-regulatory.do", method = RequestMethod.POST )
@ResponseBody
public static AddNewRegulatoryResponse addNewRegulatory( @RequestBody AddNewRegulatoryRequest request )
{
AddNewRegulatoryResponse response = new AddNewRegulatoryResponse();
// 验证文件是否存在
for ( UploadedFile file : request.getRegulatoryFiles() )
{
File uploadFile = new File(file.getAbsoluteFilePath());
if ( uploadFile.exists() == false )
{
response.setSuccess(false);
response.setMessage( "文件" + file.getAbsoluteFilePath() + "不存在!" );
return response;
}
}
return response;
}
}

View File

@@ -2,7 +2,7 @@
* @Author: Kane Wang <wangkane@qq.com>
* @Date: 2025-12-26 17:25:13
* @LastEditors: Kane Wang
* @LastModified: 2025-12-26 17:39:30
* @LastModified: 2025-12-26 21:23:04
* @FilePath: src/main/java/com/cpic/xim/web/controllers/regulatory/AddNewRegulatoryRequest.java
* @Description:
*
@@ -26,8 +26,6 @@ public class AddNewRegulatoryRequest
this.regulatoryFiles = new Vector<UploadedFile>();
}
public AddNewRegulatoryRequest(
String regulatoryName,
String departmentName,

View File

@@ -0,0 +1,22 @@
/**
* @Author: Kane Wang <wangkane@qq.com>
* @Date: 2025-12-26 21:42:12
* @LastEditors: Kane Wang
* @LastModified: 2025-12-26 21:43:54
* @FilePath: src/main/java/com/cpic/xim/web/controllers/regulatory/AddNewRegulatoryResponse.java
* @Description:
*
* Copyright (c) 2025 by Kane All rights reserved
*/
package com.cpic.xim.web.controllers.regulatory;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.cpic.xim.web.controllers.QueryResponse;
public class AddNewRegulatoryResponse extends QueryResponse
{
public AddNewRegulatoryResponse()
{
super( false, "");
}
}