实现通用文件上传、存储和访问功能,支持文件去重和多种存储策略。 主要变更: - 新增文件上传接口,支持小文件同步去重、大文件异步处理 - 实现本地存储和腾讯云COS存储策略 - 新增哈希计算服务,支持异步计算大文件哈希 - 新增文件访问控制器,提供文件访问能力 - 扩展附件实体和服务,实现完整的文件管理 - 新增配置类,支持灵活的存储策略切换 - 优化删除状态枚举类型从String改为Integer - 配置文件上传大小限制和存储相关配置 技术细节: - 小文件(<=10MB)同步计算SHA256哈希并去重 - 大文件异步计算哈希,提升上传响应速度 - 支持按日期自动组织文件目录结构 - 集成Hutool工具简化文件操作 Co-Authored-By: Claude <noreply@anthropic.com>
93 lines
3.5 KiB
XML
93 lines
3.5 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<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/xsd/maven-4.0.0.xsd">
|
|
<modelVersion>4.0.0</modelVersion>
|
|
<parent>
|
|
<groupId>cn.meowrain.aioj</groupId>
|
|
<artifactId>ai-oj</artifactId>
|
|
<version>${revision}</version>
|
|
</parent>
|
|
|
|
<packaging>jar</packaging>
|
|
<description>AIOJ 文件服务</description>
|
|
<artifactId>aioj-backend-file-service</artifactId>
|
|
|
|
<properties>
|
|
<maven.compiler.source>17</maven.compiler.source>
|
|
<maven.compiler.target>17</maven.compiler.target>
|
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
</properties>
|
|
<dependencies>
|
|
<!-- =========== 腾讯云cos =========== -->
|
|
<!-- https://mvnrepository.com/artifact/com.qcloud/cos_api -->
|
|
<dependency>
|
|
<groupId>com.qcloud</groupId>
|
|
<artifactId>cos_api</artifactId>
|
|
<version>5.6.260.1</version>
|
|
</dependency>
|
|
<!-- ==================== API文档 ==================== -->
|
|
<dependency>
|
|
<groupId>org.springdoc</groupId>
|
|
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>com.github.xiaoymin</groupId>
|
|
<artifactId>knife4j-openapi3-jakarta-spring-boot-starter</artifactId>
|
|
</dependency>
|
|
|
|
<!-- ==================== 内部模块 ==================== -->
|
|
<dependency>
|
|
<groupId>cn.meowrain.aioj</groupId>
|
|
<artifactId>aioj-backend-common-core</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>cn.meowrain.aioj</groupId>
|
|
<artifactId>aioj-backend-common-log</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>cn.meowrain.aioj</groupId>
|
|
<artifactId>aioj-backend-common-mybatis</artifactId>
|
|
</dependency>
|
|
|
|
<!-- ==================== Web ==================== -->
|
|
<dependency>
|
|
<groupId>org.springframework.boot</groupId>
|
|
<artifactId>spring-boot-starter-web</artifactId>
|
|
</dependency>
|
|
|
|
<!-- ==================== 工具类 ==================== -->
|
|
<dependency>
|
|
<groupId>cn.hutool</groupId>
|
|
<artifactId>hutool-core</artifactId>
|
|
</dependency>
|
|
|
|
<!-- ==================== 数据库 ==================== -->
|
|
<dependency>
|
|
<groupId>com.mysql</groupId>
|
|
<artifactId>mysql-connector-j</artifactId>
|
|
<scope>runtime</scope>
|
|
</dependency>
|
|
|
|
<!-- ==================== Spring Cloud 服务发现 ==================== -->
|
|
<dependency>
|
|
<groupId>com.alibaba.cloud</groupId>
|
|
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
|
</dependency>
|
|
|
|
<!-- ==================== 测试 ==================== -->
|
|
<dependency>
|
|
<groupId>org.springframework.boot</groupId>
|
|
<artifactId>spring-boot-starter-test</artifactId>
|
|
<scope>test</scope>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.springframework.boot</groupId>
|
|
<artifactId>spring-boot-starter-actuator</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>cn.hutool</groupId>
|
|
<artifactId>hutool-crypto</artifactId>
|
|
</dependency>
|
|
</dependencies>
|
|
</project> |