diff --git a/nex-be/Dockerfile b/nex-be/Dockerfile
new file mode 100644
index 0000000..0a77b4f
--- /dev/null
+++ b/nex-be/Dockerfile
@@ -0,0 +1,14 @@
+# 使用官方OpenJDK作为基础镜像
+FROM openjdk:11-jre-slim
+
+# 设置工作目录
+WORKDIR /app
+
+# 复制项目的jar文件到容器中
+COPY target/*.jar app.jar
+
+# 暴露应用端口
+EXPOSE 8080
+
+# 启动应用
+ENTRYPOINT ["java", "-jar", "app.jar"]
diff --git a/nex-be/pom.xml b/nex-be/pom.xml
new file mode 100644
index 0000000..0bc65f1
--- /dev/null
+++ b/nex-be/pom.xml
@@ -0,0 +1,63 @@
+
+
+ 4.0.0
+
+
+ org.springframework.boot
+ spring-boot-starter-parent
+ 2.7.0
+
+
+
+ com.example
+ chunked-upload-demo
+ 1.0.0
+ jar
+
+ nex-be
+ 开箱即用管理端
+
+
+ 1.8
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+
+
+ org.springframework.boot
+ spring-boot-configuration-processor
+ true
+
+
+
+ com.dampcake
+ bencode
+ 1.4
+
+
+
+ com.github.xiaoymin
+ knife4j-spring-boot-starter
+ 3.0.3
+
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+
+
+
diff --git a/nex-be/src/main/java/com/unisinsight.project/Application.java b/nex-be/src/main/java/com/unisinsight.project/Application.java
new file mode 100644
index 0000000..29e1534
--- /dev/null
+++ b/nex-be/src/main/java/com/unisinsight.project/Application.java
@@ -0,0 +1,15 @@
+package com.unisinsight.project;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+/**
+ * 分片上传应用启动类
+ */
+@SpringBootApplication
+public class Application {
+
+ public static void main(String[] args) {
+ SpringApplication.run(Application.class, args);
+ }
+}
diff --git a/nex-be/src/main/java/com/unisinsight.project/config/Knife4jConfig.java b/nex-be/src/main/java/com/unisinsight.project/config/Knife4jConfig.java
new file mode 100644
index 0000000..3d707bb
--- /dev/null
+++ b/nex-be/src/main/java/com/unisinsight.project/config/Knife4jConfig.java
@@ -0,0 +1,67 @@
+package com.unisinsight.project.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Import;
+import org.springframework.web.servlet.config.annotation.EnableWebMvc;
+import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+import springfox.bean.validators.configuration.BeanValidatorPluginsConfiguration;
+import springfox.documentation.builders.ApiInfoBuilder;
+import springfox.documentation.builders.PathSelectors;
+import springfox.documentation.builders.RequestHandlerSelectors;
+import springfox.documentation.service.ApiInfo;
+import springfox.documentation.service.Contact;
+import springfox.documentation.spi.DocumentationType;
+import springfox.documentation.spring.web.plugins.Docket;
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
+
+@Configuration
+@EnableSwagger2
+@Import(BeanValidatorPluginsConfiguration.class)
+@EnableWebMvc
+public class Knife4jConfig implements WebMvcConfigurer {
+
+ @Bean
+ public Docket defaultApi() {
+ return new Docket(DocumentationType.SWAGGER_2)
+ .apiInfo(apiInfo())
+ .groupName("默认分组")
+ .select()
+ .apis(RequestHandlerSelectors.basePackage("org.hz.controller")) // 修改为你的controller包路径
+ .paths(PathSelectors.any())
+ .build();
+ }
+
+ private ApiInfo apiInfo() {
+ return new ApiInfoBuilder()
+ .title("文件分片上传服务API")
+ .description("# 大文件分片上传接口文档\n\n"
+ + "## 功能说明\n"
+ + "1. 支持大文件分片上传\n"
+ + "2. 支持断点续传\n"
+ + "3. 自动合并完整文件\n\n"
+ + "## 使用流程\n"
+ + "1. 前端将大文件分片\n"
+ + "2. 依次上传各分片\n"
+ + "3. 系统自动合并文件")
+ .termsOfServiceUrl("http://localhost:8080/")
+ .contact(new Contact("API开发者", "https://example.com", "developer@example.com"))
+ .version("1.0.0")
+ .build();
+ }
+
+ @Override
+ public void addResourceHandlers(ResourceHandlerRegistry registry) {
+ // 配置Swagger UI和WebJars资源的访问路径,使得这些静态资源可以通过特定的URL路径在Web应用中被访问
+ registry.addResourceHandler("doc.html")
+ .addResourceLocations("classpath:/META-INF/resources/");
+
+ registry.addResourceHandler("swagger-ui.html")
+ .addResourceLocations("classpath:/META-INF/resources/");
+ registry.addResourceHandler("/webjars/**")
+ .addResourceLocations("classpath:/META-INF/resources/webjars/");
+
+ }
+
+}
diff --git a/nex-be/src/main/java/com/unisinsight.project/controller/FileChunkController.java b/nex-be/src/main/java/com/unisinsight.project/controller/FileChunkController.java
new file mode 100644
index 0000000..fcc76ef
--- /dev/null
+++ b/nex-be/src/main/java/com/unisinsight.project/controller/FileChunkController.java
@@ -0,0 +1,264 @@
+package com.unisinsight.project.controller;
+
+import io.swagger.annotations.*;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * 大文件分片上传控制器
+ */
+@RestController
+@RequestMapping("/api/files")
+@Api(tags = "文件分片上传接口")
+public class FileChunkController {
+
+ // 临时目录,用于存储上传的分片
+ @Value("${file.upload.temp-dir:${java.io.tmpdir}/chunked-uploads}")
+ private String tempDir;
+
+ // 最终文件存储目录
+ @Value("${file.upload.dir:${user.home}/uploads}")
+ private String uploadDir;
+
+ // 存储每个文件的分片信息
+ private final Map fileUploadMap = new ConcurrentHashMap<>();
+
+ /**
+ * 上传文件分片
+ *
+ * @param chunk 分片文件
+ * @param fileId 文件唯一标识符
+ * @param chunkNumber 当前分片编号(从1开始)
+ * @param totalChunks 总分片数
+ * @param fileName 原始文件名
+ * @param totalSize 文件总大小
+ * @return 上传结果
+ */
+ @PostMapping("/upload-chunk")
+ @ApiOperation(value = "上传文件分片", notes = "上传单个文件分片,当所有分片上传完成后自动合并文件")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "chunk", value = "文件分片", required = true, dataType = "__File", paramType = "form"),
+ @ApiImplicitParam(name = "fileId", value = "文件唯一标识符", required = true, dataType = "String", paramType = "query"),
+ @ApiImplicitParam(name = "chunkNumber", value = "当前分片编号(从1开始)", required = true, dataType = "int", paramType = "query"),
+ @ApiImplicitParam(name = "totalChunks", value = "总分片数", required = true, dataType = "int", paramType = "query"),
+ @ApiImplicitParam(name = "fileName", value = "原始文件名", required = true, dataType = "String", paramType = "query"),
+ @ApiImplicitParam(name = "totalSize", value = "文件总大小", required = true, dataType = "long", paramType = "query")
+ })
+ @ApiResponses({
+ @ApiResponse(code = 200, message = "上传成功"),
+ @ApiResponse(code = 500, message = "服务器内部错误")
+ })
+ public ResponseEntity