From 161b5e5bfc1d5c343718f228457945fa21cc9f60 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Wed, 28 Feb 2024 18:59:49 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20=E5=85=A8=E5=B1=80=EF=BC=9A?= =?UTF-8?q?=E7=AE=80=E5=8C=96=20file=20=E7=BB=84=E4=BB=B6=EF=BC=8C?= =?UTF-8?q?=E8=9E=8D=E5=90=88=E5=88=B0=20infra=20=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yudao-dependencies/pom.xml | 5 -- yudao-framework/pom.xml | 1 - .../framework/common/util/json/JsonUtils.java | 15 ++++ .../yudao-spring-boot-starter-file/pom.xml | 83 ------------------ .../config/YudaoFileAutoConfiguration.java | 21 ----- .../file/core/client/db/DBFileClient.java | 48 ---------- .../client/db/DBFileContentFrameworkDAO.java | 36 -------- .../file/core/enums/FileStorageEnum.java | 55 ------------ ...ot.autoconfigure.AutoConfiguration.imports | 1 - .../framework/file/config/package-info.java | 4 - .../file/core/enums/package-info.java | 4 - .../src/test/resources/file/erweima.jpg | Bin 18385 -> 0 bytes .../yudao-module-infra-biz/pom.xml | 17 +++- .../file/vo/config/FileConfigRespVO.java | 2 +- .../dal/dataobject/file/FileConfigDO.java | 51 ++++++++++- .../dal/dataobject/file/FileContentDO.java | 3 +- .../dal/mysql/file/FileContentDAOImpl.java | 46 ---------- .../dal/mysql/file/FileContentMapper.java | 16 ++++ .../config/YudaoFileAutoConfiguration.java | 21 +++++ .../file/core/client/AbstractFileClient.java | 2 +- .../file/core/client/FileClient.java | 4 +- .../file/core/client/FileClientConfig.java | 2 +- .../file/core/client/FileClientFactory.java | 6 +- .../core/client/FileClientFactoryImpl.java | 4 +- .../file/core/client/db/DBFileClient.java | 55 ++++++++++++ .../core/client/db/DBFileClientConfig.java | 7 +- .../file/core/client/ftp/FtpFileClient.java | 4 +- .../core/client/ftp/FtpFileClientConfig.java | 9 +- .../core/client/local/LocalFileClient.java | 4 +- .../client/local/LocalFileClientConfig.java | 7 +- .../client/s3/FilePresignedUrlRespDTO.java | 2 +- .../file/core/client/s3/S3FileClient.java | 13 ++- .../core/client/s3/S3FileClientConfig.java | 9 +- .../file/core/client/sftp/SftpFileClient.java | 4 +- .../client/sftp/SftpFileClientConfig.java | 9 +- .../file/core/enums/FileStorageEnum.java | 55 ++++++++++++ .../file/core/utils/FileTypeUtils.java | 2 +- .../infra/framework/file/package-info.java | 12 +++ .../infra/service/file/FileConfigService.java | 2 +- .../service/file/FileConfigServiceImpl.java | 8 +- .../infra/service/file/FileServiceImpl.java | 6 +- .../file/core}/ftp/FtpFileClientTest.java | 4 +- .../file/core}/local/LocalFileClientTest.java | 4 +- .../file/core}/s3/S3FileClientTest.java | 7 +- .../file/core}/sftp/SftpFileClientTest.java | 4 +- .../file/FileConfigServiceImplTest.java | 12 +-- .../service/file/FileServiceImplTest.java | 2 +- 47 files changed, 308 insertions(+), 380 deletions(-) delete mode 100644 yudao-framework/yudao-spring-boot-starter-file/pom.xml delete mode 100644 yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/config/YudaoFileAutoConfiguration.java delete mode 100644 yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/db/DBFileClient.java delete mode 100644 yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/db/DBFileContentFrameworkDAO.java delete mode 100644 yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/enums/FileStorageEnum.java delete mode 100644 yudao-framework/yudao-spring-boot-starter-file/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports delete mode 100644 yudao-framework/yudao-spring-boot-starter-file/src/test/java/cn/iocoder/yudao/framework/file/config/package-info.java delete mode 100644 yudao-framework/yudao-spring-boot-starter-file/src/test/java/cn/iocoder/yudao/framework/file/core/enums/package-info.java delete mode 100644 yudao-framework/yudao-spring-boot-starter-file/src/test/resources/file/erweima.jpg delete mode 100644 yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/file/FileContentDAOImpl.java create mode 100644 yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/config/YudaoFileAutoConfiguration.java rename {yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao => yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra}/framework/file/core/client/AbstractFileClient.java (95%) rename {yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao => yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra}/framework/file/core/client/FileClient.java (87%) rename {yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao => yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra}/framework/file/core/client/FileClientConfig.java (87%) rename {yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao => yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra}/framework/file/core/client/FileClientFactory.java (67%) rename {yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao => yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra}/framework/file/core/client/FileClientFactoryImpl.java (92%) create mode 100644 yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/db/DBFileClient.java rename {yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao => yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra}/framework/file/core/client/db/DBFileClientConfig.java (74%) rename {yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao => yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra}/framework/file/core/client/ftp/FtpFileClient.java (94%) rename {yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao => yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra}/framework/file/core/client/ftp/FtpFileClientConfig.java (88%) rename {yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao => yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra}/framework/file/core/client/local/LocalFileClient.java (88%) rename {yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao => yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra}/framework/file/core/client/local/LocalFileClientConfig.java (78%) rename {yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao => yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra}/framework/file/core/client/s3/FilePresignedUrlRespDTO.java (86%) rename {yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao => yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra}/framework/file/core/client/s3/S3FileClient.java (89%) rename {yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao => yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra}/framework/file/core/client/s3/S3FileClientConfig.java (94%) rename {yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao => yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra}/framework/file/core/client/sftp/SftpFileClient.java (91%) rename {yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao => yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra}/framework/file/core/client/sftp/SftpFileClientConfig.java (86%) create mode 100644 yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/enums/FileStorageEnum.java rename {yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao => yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra}/framework/file/core/utils/FileTypeUtils.java (95%) create mode 100644 yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/package-info.java rename {yudao-framework/yudao-spring-boot-starter-file/src/test/java/cn/iocoder/yudao/framework/file/core/client => yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/framework/file/core}/ftp/FtpFileClientTest.java (83%) rename {yudao-framework/yudao-spring-boot-starter-file/src/test/java/cn/iocoder/yudao/framework/file/core/client => yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/framework/file/core}/local/LocalFileClientTest.java (77%) rename {yudao-framework/yudao-spring-boot-starter-file/src/test/java/cn/iocoder/yudao/framework/file/core/client => yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/framework/file/core}/s3/S3FileClientTest.java (95%) rename {yudao-framework/yudao-spring-boot-starter-file/src/test/java/cn/iocoder/yudao/framework/file/core/client => yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/framework/file/core}/sftp/SftpFileClientTest.java (82%) diff --git a/yudao-dependencies/pom.xml b/yudao-dependencies/pom.xml index dfd82713c..e011c5f11 100644 --- a/yudao-dependencies/pom.xml +++ b/yudao-dependencies/pom.xml @@ -603,11 +603,6 @@ okhttp ${okhttp3.version} - - cn.iocoder.cloud - yudao-spring-boot-starter-file - ${revision} - io.minio minio diff --git a/yudao-framework/pom.xml b/yudao-framework/pom.xml index fdf80494f..9d63f3079 100644 --- a/yudao-framework/pom.xml +++ b/yudao-framework/pom.xml @@ -17,7 +17,6 @@ yudao-spring-boot-starter-web yudao-spring-boot-starter-security - yudao-spring-boot-starter-file yudao-spring-boot-starter-monitor yudao-spring-boot-starter-protection diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/json/JsonUtils.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/json/JsonUtils.java index 2c7288efa..2cbe93ca8 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/json/JsonUtils.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/json/JsonUtils.java @@ -136,6 +136,21 @@ public class JsonUtils { } } + /** + * 解析 JSON 字符串成指定类型的对象,如果解析失败,则返回 null + * + * @param text 字符串 + * @param typeReference 类型引用 + * @return 指定类型的对象 + */ + public static T parseObjectQuietly(String text, TypeReference typeReference) { + try { + return objectMapper.readValue(text, typeReference); + } catch (IOException e) { + return null; + } + } + public static List parseArray(String text, Class clazz) { if (StrUtil.isEmpty(text)) { return new ArrayList<>(); diff --git a/yudao-framework/yudao-spring-boot-starter-file/pom.xml b/yudao-framework/yudao-spring-boot-starter-file/pom.xml deleted file mode 100644 index 905e0f7c1..000000000 --- a/yudao-framework/yudao-spring-boot-starter-file/pom.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - - yudao-framework - cn.iocoder.cloud - ${revision} - - 4.0.0 - yudao-spring-boot-starter-file - - ${project.artifactId} - 文件客户端,支持多种存储器 - 1. file:本地磁盘 - 2. ftp:FTP 服务器 - 2. sftp:SFTP 服务器 - 4. db:数据库 - 5. s3:支持 S3 协议的云存储服务,例如说 MinIO、阿里云、华为云、腾讯云、七牛云等等 - - https://github.com/YunaiV/ruoyi-vue-pro - - - - cn.iocoder.cloud - yudao-common - - - - - org.springframework.boot - spring-boot-starter - - - - - org.springframework.boot - spring-boot-starter-validation - - - - org.slf4j - slf4j-api - - - - com.fasterxml.jackson.core - jackson-databind - - - com.fasterxml.jackson.core - jackson-core - - - - commons-net - commons-net - - - com.jcraft - jsch - - - - org.apache.tika - tika-core - - - - - io.minio - minio - - - - - cn.iocoder.cloud - yudao-spring-boot-starter-test - test - - - - diff --git a/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/config/YudaoFileAutoConfiguration.java b/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/config/YudaoFileAutoConfiguration.java deleted file mode 100644 index e22ee3dd0..000000000 --- a/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/config/YudaoFileAutoConfiguration.java +++ /dev/null @@ -1,21 +0,0 @@ -package cn.iocoder.yudao.framework.file.config; - -import cn.iocoder.yudao.framework.file.core.client.FileClientFactory; -import cn.iocoder.yudao.framework.file.core.client.FileClientFactoryImpl; -import org.springframework.boot.autoconfigure.AutoConfiguration; -import org.springframework.context.annotation.Bean; - -/** - * 文件配置类 - * - * @author 芋道源码 - */ -@AutoConfiguration -public class YudaoFileAutoConfiguration { - - @Bean - public FileClientFactory fileClientFactory() { - return new FileClientFactoryImpl(); - } - -} diff --git a/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/db/DBFileClient.java b/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/db/DBFileClient.java deleted file mode 100644 index 1e2c082fe..000000000 --- a/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/db/DBFileClient.java +++ /dev/null @@ -1,48 +0,0 @@ -package cn.iocoder.yudao.framework.file.core.client.db; - -import cn.hutool.extra.spring.SpringUtil; -import cn.iocoder.yudao.framework.file.core.client.AbstractFileClient; - -/** - * 基于 DB 存储的文件客户端的配置类 - * - * @author 芋道源码 - */ -public class DBFileClient extends AbstractFileClient { - - private DBFileContentFrameworkDAO dao; - - public DBFileClient(Long id, DBFileClientConfig config) { - super(id, config); - } - - @Override - protected void doInit() { - } - - @Override - public String upload(byte[] content, String path, String type) { - getDao().insert(getId(), path, content); - // 拼接返回路径 - return super.formatFileUrl(config.getDomain(), path); - } - - @Override - public void delete(String path) { - getDao().delete(getId(), path); - } - - @Override - public byte[] getContent(String path) { - return getDao().selectContent(getId(), path); - } - - private DBFileContentFrameworkDAO getDao() { - // 延迟获取,因为 SpringUtil 初始化太慢 - if (dao == null) { - dao = SpringUtil.getBean(DBFileContentFrameworkDAO.class); - } - return dao; - } - -} diff --git a/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/db/DBFileContentFrameworkDAO.java b/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/db/DBFileContentFrameworkDAO.java deleted file mode 100644 index 9423e065d..000000000 --- a/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/db/DBFileContentFrameworkDAO.java +++ /dev/null @@ -1,36 +0,0 @@ -package cn.iocoder.yudao.framework.file.core.client.db; - -/** - * 文件内容 Framework DAO 接口 - * - * @author 芋道源码 - */ -public interface DBFileContentFrameworkDAO { - - /** - * 插入文件内容 - * - * @param configId 配置编号 - * @param path 路径 - * @param content 内容 - */ - void insert(Long configId, String path, byte[] content); - - /** - * 删除文件内容 - * - * @param configId 配置编号 - * @param path 路径 - */ - void delete(Long configId, String path); - - /** - * 获得文件内容 - * - * @param configId 配置编号 - * @param path 路径 - * @return 内容 - */ - byte[] selectContent(Long configId, String path); - -} diff --git a/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/enums/FileStorageEnum.java b/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/enums/FileStorageEnum.java deleted file mode 100644 index 03c6ed8a7..000000000 --- a/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/enums/FileStorageEnum.java +++ /dev/null @@ -1,55 +0,0 @@ -package cn.iocoder.yudao.framework.file.core.enums; - -import cn.hutool.core.util.ArrayUtil; -import cn.iocoder.yudao.framework.file.core.client.FileClient; -import cn.iocoder.yudao.framework.file.core.client.FileClientConfig; -import cn.iocoder.yudao.framework.file.core.client.db.DBFileClient; -import cn.iocoder.yudao.framework.file.core.client.db.DBFileClientConfig; -import cn.iocoder.yudao.framework.file.core.client.ftp.FtpFileClient; -import cn.iocoder.yudao.framework.file.core.client.ftp.FtpFileClientConfig; -import cn.iocoder.yudao.framework.file.core.client.local.LocalFileClient; -import cn.iocoder.yudao.framework.file.core.client.local.LocalFileClientConfig; -import cn.iocoder.yudao.framework.file.core.client.s3.S3FileClient; -import cn.iocoder.yudao.framework.file.core.client.s3.S3FileClientConfig; -import cn.iocoder.yudao.framework.file.core.client.sftp.SftpFileClient; -import cn.iocoder.yudao.framework.file.core.client.sftp.SftpFileClientConfig; -import lombok.AllArgsConstructor; -import lombok.Getter; - -/** - * 文件存储器枚举 - * - * @author 芋道源码 - */ -@AllArgsConstructor -@Getter -public enum FileStorageEnum { - - DB(1, DBFileClientConfig.class, DBFileClient.class), - - LOCAL(10, LocalFileClientConfig.class, LocalFileClient.class), - FTP(11, FtpFileClientConfig.class, FtpFileClient.class), - SFTP(12, SftpFileClientConfig.class, SftpFileClient.class), - - S3(20, S3FileClientConfig.class, S3FileClient.class), - ; - - /** - * 存储器 - */ - private final Integer storage; - - /** - * 配置类 - */ - private final Class configClass; - /** - * 客户端类 - */ - private final Class clientClass; - - public static FileStorageEnum getByStorage(Integer storage) { - return ArrayUtil.firstMatch(o -> o.getStorage().equals(storage), values()); - } - -} diff --git a/yudao-framework/yudao-spring-boot-starter-file/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/yudao-framework/yudao-spring-boot-starter-file/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports deleted file mode 100644 index f1536687e..000000000 --- a/yudao-framework/yudao-spring-boot-starter-file/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ /dev/null @@ -1 +0,0 @@ -cn.iocoder.yudao.framework.file.config.YudaoFileAutoConfiguration diff --git a/yudao-framework/yudao-spring-boot-starter-file/src/test/java/cn/iocoder/yudao/framework/file/config/package-info.java b/yudao-framework/yudao-spring-boot-starter-file/src/test/java/cn/iocoder/yudao/framework/file/config/package-info.java deleted file mode 100644 index 113f3e5e5..000000000 --- a/yudao-framework/yudao-spring-boot-starter-file/src/test/java/cn/iocoder/yudao/framework/file/config/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * 占位,避免 package 无法提交到 Git 仓库 - */ -package cn.iocoder.yudao.framework.file.config; diff --git a/yudao-framework/yudao-spring-boot-starter-file/src/test/java/cn/iocoder/yudao/framework/file/core/enums/package-info.java b/yudao-framework/yudao-spring-boot-starter-file/src/test/java/cn/iocoder/yudao/framework/file/core/enums/package-info.java deleted file mode 100644 index e1da5db23..000000000 --- a/yudao-framework/yudao-spring-boot-starter-file/src/test/java/cn/iocoder/yudao/framework/file/core/enums/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * 占位,避免 package 无法提交到 Git 仓库 - */ -package cn.iocoder.yudao.framework.file.core.enums; diff --git a/yudao-framework/yudao-spring-boot-starter-file/src/test/resources/file/erweima.jpg b/yudao-framework/yudao-spring-boot-starter-file/src/test/resources/file/erweima.jpg deleted file mode 100644 index 1447283cdf1b49b51c1204a160e01cb789e957a8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18385 zcmb7s2Rzm9+yCL%A+xNq$sv0yBYV$7${yL72_=by>^(#Fv7$0Ev!kp?5wb^FWrg_P zpQHMH%lG#@|3|%E9nLwQao^YbdXMYm@crQ@7>SC4vH}bP0|vtYe_)5BFj*KJ6BGIi zzOcYwY&>jiEG%pSTwEMHLIOg<69gwt5D}A+5D}9SpEyBsiiDJ$f|8Pw@Z@Q#QxsHW z6qFRuK``LpJy_WI*x2|KL??(S{?A{B%`j3t3``76I0h*UlN19^igDNqI}3xsF@Ao* zj=u2laWQZRFtM=V;CVW5C*U2>{rvjEz{bSF!G+@;j=%`v;8_wl33v)+_Urjy|Kg$_ zEYOL&EWqgCnJzFG_?HFa?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net + + + com.jcraft + jsch + + + io.minio + minio + + + + org.apache.tika + tika-core diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/config/FileConfigRespVO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/config/FileConfigRespVO.java index e3bb6fe88..e344f82e1 100755 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/config/FileConfigRespVO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/vo/config/FileConfigRespVO.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.module.infra.controller.admin.file.vo.config; -import cn.iocoder.yudao.framework.file.core.client.FileClientConfig; +import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClientConfig; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/file/FileConfigDO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/file/FileConfigDO.java index c30a9d5c1..ac2d4d028 100755 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/file/FileConfigDO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/file/FileConfigDO.java @@ -1,12 +1,20 @@ package cn.iocoder.yudao.module.infra.dal.dataobject.file; -import cn.iocoder.yudao.framework.file.core.client.FileClientConfig; -import cn.iocoder.yudao.framework.file.core.enums.FileStorageEnum; +import cn.hutool.core.util.StrUtil; +import cn.iocoder.yudao.framework.common.util.json.JsonUtils; import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; +import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClientConfig; +import cn.iocoder.yudao.module.infra.framework.file.core.client.db.DBFileClientConfig; +import cn.iocoder.yudao.module.infra.framework.file.core.client.ftp.FtpFileClientConfig; +import cn.iocoder.yudao.module.infra.framework.file.core.client.local.LocalFileClientConfig; +import cn.iocoder.yudao.module.infra.framework.file.core.client.s3.S3FileClientConfig; +import cn.iocoder.yudao.module.infra.framework.file.core.client.sftp.SftpFileClientConfig; +import cn.iocoder.yudao.module.infra.framework.file.core.enums.FileStorageEnum; import com.baomidou.mybatisplus.annotation.KeySequence; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; +import com.baomidou.mybatisplus.extension.handlers.AbstractJsonTypeHandler; +import com.fasterxml.jackson.core.type.TypeReference; import lombok.*; /** @@ -52,7 +60,42 @@ public class FileConfigDO extends BaseDO { /** * 支付渠道配置 */ - @TableField(typeHandler = JacksonTypeHandler.class) + @TableField(typeHandler = FileClientConfigTypeHandler.class) private FileClientConfig config; + public static class FileClientConfigTypeHandler extends AbstractJsonTypeHandler { + + @Override + protected Object parse(String json) { + FileClientConfig config = JsonUtils.parseObjectQuietly(json, new TypeReference<>() {}); + if (config != null) { + return config; + } + + // 兼容老版本的包路径 + String className = JsonUtils.parseObject(json, "@class", String.class); + className = StrUtil.subAfter(className, ".", true); + switch (className) { + case "DBFileClientConfig": + return JsonUtils.parseObject2(json, DBFileClientConfig.class); + case "FtpFileClientConfig": + return JsonUtils.parseObject2(json, FtpFileClientConfig.class); + case "LocalFileClientConfig": + return JsonUtils.parseObject2(json, LocalFileClientConfig.class); + case "SftpFileClientConfig": + return JsonUtils.parseObject2(json, SftpFileClientConfig.class); + case "S3FileClientConfig": + return JsonUtils.parseObject2(json, S3FileClientConfig.class); + default: + throw new IllegalArgumentException("未知的 FileClientConfig 类型:" + json); + } + } + + @Override + protected String toJson(Object obj) { + return JsonUtils.toJsonString(obj); + } + + } + } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/file/FileContentDO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/file/FileContentDO.java index e19a1ce9f..eda8a7264 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/file/FileContentDO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/dataobject/file/FileContentDO.java @@ -1,6 +1,7 @@ package cn.iocoder.yudao.module.infra.dal.dataobject.file; import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; +import cn.iocoder.yudao.module.infra.framework.file.core.client.db.DBFileClient; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.KeySequence; import com.baomidou.mybatisplus.annotation.TableId; @@ -10,7 +11,7 @@ import lombok.*; /** * 文件内容表 * - * 专门用于存储 {@link cn.iocoder.yudao.framework.file.core.client.db.DBFileClient} 的文件内容 + * 专门用于存储 {@link DBFileClient} 的文件内容 * * @author 芋道源码 */ diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/file/FileContentDAOImpl.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/file/FileContentDAOImpl.java deleted file mode 100644 index b90bed673..000000000 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/file/FileContentDAOImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -package cn.iocoder.yudao.module.infra.dal.mysql.file; - -import cn.hutool.core.collection.CollUtil; -import cn.iocoder.yudao.framework.file.core.client.db.DBFileContentFrameworkDAO; -import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileContentDO; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import org.springframework.stereotype.Repository; - -import jakarta.annotation.Resource; -import java.util.List; -import java.util.Optional; - -@Repository -public class FileContentDAOImpl implements DBFileContentFrameworkDAO { - - @Resource - private FileContentMapper fileContentMapper; - - @Override - public void insert(Long configId, String path, byte[] content) { - FileContentDO entity = new FileContentDO().setConfigId(configId) - .setPath(path).setContent(content); - fileContentMapper.insert(entity); - } - - @Override - public void delete(Long configId, String path) { - fileContentMapper.delete(buildQuery(configId, path)); - } - - @Override - public byte[] selectContent(Long configId, String path) { - List list = fileContentMapper.selectList( - buildQuery(configId, path).select(FileContentDO::getContent).orderByDesc(FileContentDO::getId)); - return Optional.ofNullable(CollUtil.getFirst(list)) - .map(FileContentDO::getContent) - .orElse(null); - } - - private LambdaQueryWrapper buildQuery(Long configId, String path) { - return new LambdaQueryWrapper() - .eq(FileContentDO::getConfigId, configId) - .eq(FileContentDO::getPath, path); - } - -} diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/file/FileContentMapper.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/file/FileContentMapper.java index 501979dbe..3d6ec5155 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/file/FileContentMapper.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/file/FileContentMapper.java @@ -1,9 +1,25 @@ package cn.iocoder.yudao.module.infra.dal.mysql.file; import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileContentDO; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + @Mapper public interface FileContentMapper extends BaseMapper { + + default void deleteByConfigIdAndPath(Long configId, String path) { + this.delete(new LambdaQueryWrapper() + .eq(FileContentDO::getConfigId, configId) + .eq(FileContentDO::getPath, path)); + } + + default List selectListByConfigIdAndPath(Long configId, String path) { + return selectList(new LambdaQueryWrapper() + .eq(FileContentDO::getConfigId, configId) + .eq(FileContentDO::getPath, path)); + } + } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/config/YudaoFileAutoConfiguration.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/config/YudaoFileAutoConfiguration.java new file mode 100644 index 000000000..e0d3f8e74 --- /dev/null +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/config/YudaoFileAutoConfiguration.java @@ -0,0 +1,21 @@ +package cn.iocoder.yudao.module.infra.framework.file.config; + +import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClientFactory; +import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClientFactoryImpl; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * 文件配置类 + * + * @author 芋道源码 + */ +@Configuration(proxyBeanMethods = false) +public class YudaoFileAutoConfiguration { + + @Bean + public FileClientFactory fileClientFactory() { + return new FileClientFactoryImpl(); + } + +} diff --git a/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/AbstractFileClient.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/AbstractFileClient.java similarity index 95% rename from yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/AbstractFileClient.java rename to yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/AbstractFileClient.java index b21ccc0e1..3c7883b83 100644 --- a/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/AbstractFileClient.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/AbstractFileClient.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.framework.file.core.client; +package cn.iocoder.yudao.module.infra.framework.file.core.client; import cn.hutool.core.util.StrUtil; import lombok.extern.slf4j.Slf4j; diff --git a/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/FileClient.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/FileClient.java similarity index 87% rename from yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/FileClient.java rename to yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/FileClient.java index 2944ca72c..053b3c510 100644 --- a/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/FileClient.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/FileClient.java @@ -1,6 +1,6 @@ -package cn.iocoder.yudao.framework.file.core.client; +package cn.iocoder.yudao.module.infra.framework.file.core.client; -import cn.iocoder.yudao.framework.file.core.client.s3.FilePresignedUrlRespDTO; +import cn.iocoder.yudao.module.infra.framework.file.core.client.s3.FilePresignedUrlRespDTO; /** * 文件客户端 diff --git a/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/FileClientConfig.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/FileClientConfig.java similarity index 87% rename from yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/FileClientConfig.java rename to yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/FileClientConfig.java index 9461c05d8..ed092759a 100644 --- a/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/FileClientConfig.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/FileClientConfig.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.framework.file.core.client; +package cn.iocoder.yudao.module.infra.framework.file.core.client; import com.fasterxml.jackson.annotation.JsonTypeInfo; diff --git a/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/FileClientFactory.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/FileClientFactory.java similarity index 67% rename from yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/FileClientFactory.java rename to yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/FileClientFactory.java index db90f4892..e4c84ed10 100644 --- a/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/FileClientFactory.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/FileClientFactory.java @@ -1,4 +1,6 @@ -package cn.iocoder.yudao.framework.file.core.client; +package cn.iocoder.yudao.module.infra.framework.file.core.client; + +import cn.iocoder.yudao.module.infra.framework.file.core.enums.FileStorageEnum; public interface FileClientFactory { @@ -14,7 +16,7 @@ public interface FileClientFactory { * 创建文件客户端 * * @param configId 配置编号 - * @param storage 存储器的枚举 {@link cn.iocoder.yudao.framework.file.core.enums.FileStorageEnum} + * @param storage 存储器的枚举 {@link FileStorageEnum} * @param config 文件配置 */ void createOrUpdateFileClient(Long configId, Integer storage, Config config); diff --git a/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/FileClientFactoryImpl.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/FileClientFactoryImpl.java similarity index 92% rename from yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/FileClientFactoryImpl.java rename to yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/FileClientFactoryImpl.java index 980f8a310..2bd54648f 100644 --- a/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/FileClientFactoryImpl.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/FileClientFactoryImpl.java @@ -1,8 +1,8 @@ -package cn.iocoder.yudao.framework.file.core.client; +package cn.iocoder.yudao.module.infra.framework.file.core.client; import cn.hutool.core.lang.Assert; import cn.hutool.core.util.ReflectUtil; -import cn.iocoder.yudao.framework.file.core.enums.FileStorageEnum; +import cn.iocoder.yudao.module.infra.framework.file.core.enums.FileStorageEnum; import lombok.extern.slf4j.Slf4j; import java.util.concurrent.ConcurrentHashMap; diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/db/DBFileClient.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/db/DBFileClient.java new file mode 100644 index 000000000..0a050d325 --- /dev/null +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/db/DBFileClient.java @@ -0,0 +1,55 @@ +package cn.iocoder.yudao.module.infra.framework.file.core.client.db; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.extra.spring.SpringUtil; +import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileContentDO; +import cn.iocoder.yudao.module.infra.dal.mysql.file.FileContentMapper; +import cn.iocoder.yudao.module.infra.framework.file.core.client.AbstractFileClient; + +import java.util.Comparator; +import java.util.List; + +/** + * 基于 DB 存储的文件客户端的配置类 + * + * @author 芋道源码 + */ +public class DBFileClient extends AbstractFileClient { + + private FileContentMapper fileContentMapper; + + public DBFileClient(Long id, DBFileClientConfig config) { + super(id, config); + } + + @Override + protected void doInit() { + fileContentMapper = SpringUtil.getBean(FileContentMapper.class); + } + + @Override + public String upload(byte[] content, String path, String type) { + FileContentDO contentDO = new FileContentDO().setConfigId(getId()) + .setPath(path).setContent(content); + fileContentMapper.insert(contentDO); + // 拼接返回路径 + return super.formatFileUrl(config.getDomain(), path); + } + + @Override + public void delete(String path) { + fileContentMapper.deleteByConfigIdAndPath(getId(), path); + } + + @Override + public byte[] getContent(String path) { + List list = fileContentMapper.selectListByConfigIdAndPath(getId(), path); + if (CollUtil.isEmpty(list)) { + return null; + } + // 排序后,拿 id 最大的,即最后上传的 + list.sort(Comparator.comparing(FileContentDO::getId)); + return CollUtil.getLast(list).getContent(); + } + +} diff --git a/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/db/DBFileClientConfig.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/db/DBFileClientConfig.java similarity index 74% rename from yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/db/DBFileClientConfig.java rename to yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/db/DBFileClientConfig.java index 23367aff0..0bd1a8a18 100644 --- a/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/db/DBFileClientConfig.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/db/DBFileClientConfig.java @@ -1,11 +1,10 @@ -package cn.iocoder.yudao.framework.file.core.client.db; +package cn.iocoder.yudao.module.infra.framework.file.core.client.db; -import cn.iocoder.yudao.framework.file.core.client.FileClientConfig; +import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClientConfig; +import jakarta.validation.constraints.NotEmpty; import lombok.Data; import org.hibernate.validator.constraints.URL; -import jakarta.validation.constraints.NotEmpty; - /** * 基于 DB 存储的文件客户端的配置类 * diff --git a/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/ftp/FtpFileClient.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/ftp/FtpFileClient.java similarity index 94% rename from yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/ftp/FtpFileClient.java rename to yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/ftp/FtpFileClient.java index 796044f3f..062d83818 100644 --- a/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/ftp/FtpFileClient.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/ftp/FtpFileClient.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.framework.file.core.client.ftp; +package cn.iocoder.yudao.module.infra.framework.file.core.client.ftp; import cn.hutool.core.io.FileUtil; import cn.hutool.core.util.CharsetUtil; @@ -6,7 +6,7 @@ import cn.hutool.core.util.StrUtil; import cn.hutool.extra.ftp.Ftp; import cn.hutool.extra.ftp.FtpException; import cn.hutool.extra.ftp.FtpMode; -import cn.iocoder.yudao.framework.file.core.client.AbstractFileClient; +import cn.iocoder.yudao.module.infra.framework.file.core.client.AbstractFileClient; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; diff --git a/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/ftp/FtpFileClientConfig.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/ftp/FtpFileClientConfig.java similarity index 88% rename from yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/ftp/FtpFileClientConfig.java rename to yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/ftp/FtpFileClientConfig.java index a442ddd7f..c1cbb18e7 100644 --- a/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/ftp/FtpFileClientConfig.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/ftp/FtpFileClientConfig.java @@ -1,11 +1,10 @@ -package cn.iocoder.yudao.framework.file.core.client.ftp; - -import cn.iocoder.yudao.framework.file.core.client.FileClientConfig; -import lombok.Data; -import org.hibernate.validator.constraints.URL; +package cn.iocoder.yudao.module.infra.framework.file.core.client.ftp; +import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClientConfig; import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.NotNull; +import lombok.Data; +import org.hibernate.validator.constraints.URL; /** * Ftp 文件客户端的配置类 diff --git a/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/local/LocalFileClient.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/local/LocalFileClient.java similarity index 88% rename from yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/local/LocalFileClient.java rename to yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/local/LocalFileClient.java index cac13f1fb..a9196903e 100644 --- a/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/local/LocalFileClient.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/local/LocalFileClient.java @@ -1,7 +1,7 @@ -package cn.iocoder.yudao.framework.file.core.client.local; +package cn.iocoder.yudao.module.infra.framework.file.core.client.local; import cn.hutool.core.io.FileUtil; -import cn.iocoder.yudao.framework.file.core.client.AbstractFileClient; +import cn.iocoder.yudao.module.infra.framework.file.core.client.AbstractFileClient; import java.io.File; diff --git a/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/local/LocalFileClientConfig.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/local/LocalFileClientConfig.java similarity index 78% rename from yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/local/LocalFileClientConfig.java rename to yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/local/LocalFileClientConfig.java index 1d54eebd5..1723ce79d 100644 --- a/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/local/LocalFileClientConfig.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/local/LocalFileClientConfig.java @@ -1,11 +1,10 @@ -package cn.iocoder.yudao.framework.file.core.client.local; +package cn.iocoder.yudao.module.infra.framework.file.core.client.local; -import cn.iocoder.yudao.framework.file.core.client.FileClientConfig; +import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClientConfig; +import jakarta.validation.constraints.NotEmpty; import lombok.Data; import org.hibernate.validator.constraints.URL; -import jakarta.validation.constraints.NotEmpty; - /** * 本地文件客户端的配置类 * diff --git a/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/s3/FilePresignedUrlRespDTO.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/s3/FilePresignedUrlRespDTO.java similarity index 86% rename from yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/s3/FilePresignedUrlRespDTO.java rename to yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/s3/FilePresignedUrlRespDTO.java index 6048494ed..6a1258e9e 100644 --- a/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/s3/FilePresignedUrlRespDTO.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/s3/FilePresignedUrlRespDTO.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.framework.file.core.client.s3; +package cn.iocoder.yudao.module.infra.framework.file.core.client.s3; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/s3/S3FileClient.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/s3/S3FileClient.java similarity index 89% rename from yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/s3/S3FileClient.java rename to yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/s3/S3FileClient.java index e7b470bad..67995caa2 100644 --- a/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/s3/S3FileClient.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/s3/S3FileClient.java @@ -1,18 +1,15 @@ -package cn.iocoder.yudao.framework.file.core.client.s3; +package cn.iocoder.yudao.module.infra.framework.file.core.client.s3; import cn.hutool.core.io.IoUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.http.HttpUtil; -import cn.iocoder.yudao.framework.file.core.client.AbstractFileClient; +import cn.iocoder.yudao.module.infra.framework.file.core.client.AbstractFileClient; import io.minio.*; import io.minio.http.Method; import java.io.ByteArrayInputStream; import java.util.concurrent.TimeUnit; -import static cn.iocoder.yudao.framework.file.core.client.s3.S3FileClientConfig.ENDPOINT_ALIYUN; -import static cn.iocoder.yudao.framework.file.core.client.s3.S3FileClientConfig.ENDPOINT_TENCENT; - /** * 基于 S3 协议的文件客户端,实现 MinIO、阿里云、腾讯云、七牛云、华为云等云服务 *

@@ -76,15 +73,15 @@ public class S3FileClient extends AbstractFileClient { */ private String buildRegion() { // 阿里云必须有 region,否则会报错 - if (config.getEndpoint().contains(ENDPOINT_ALIYUN)) { + if (config.getEndpoint().contains(S3FileClientConfig.ENDPOINT_ALIYUN)) { return StrUtil.subBefore(config.getEndpoint(), '.', false) .replaceAll("-internal", "")// 去除内网 Endpoint 的后缀 .replaceAll("https://", ""); } // 腾讯云必须有 region,否则会报错 - if (config.getEndpoint().contains(ENDPOINT_TENCENT)) { + if (config.getEndpoint().contains(S3FileClientConfig.ENDPOINT_TENCENT)) { return StrUtil.subAfter(config.getEndpoint(), "cos.", false) - .replaceAll("." + ENDPOINT_TENCENT, ""); // 去除 Endpoint + .replaceAll("." + S3FileClientConfig.ENDPOINT_TENCENT, ""); // 去除 Endpoint } return null; } diff --git a/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/s3/S3FileClientConfig.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/s3/S3FileClientConfig.java similarity index 94% rename from yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/s3/S3FileClientConfig.java rename to yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/s3/S3FileClientConfig.java index b52583986..3d9e3c561 100644 --- a/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/s3/S3FileClientConfig.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/s3/S3FileClientConfig.java @@ -1,13 +1,12 @@ -package cn.iocoder.yudao.framework.file.core.client.s3; +package cn.iocoder.yudao.module.infra.framework.file.core.client.s3; import cn.hutool.core.util.StrUtil; -import cn.iocoder.yudao.framework.file.core.client.FileClientConfig; +import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClientConfig; import com.fasterxml.jackson.annotation.JsonIgnore; -import lombok.Data; -import org.hibernate.validator.constraints.URL; - import jakarta.validation.constraints.AssertTrue; import jakarta.validation.constraints.NotNull; +import lombok.Data; +import org.hibernate.validator.constraints.URL; /** * S3 文件客户端的配置类 diff --git a/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/sftp/SftpFileClient.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/sftp/SftpFileClient.java similarity index 91% rename from yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/sftp/SftpFileClient.java rename to yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/sftp/SftpFileClient.java index facddcea0..3ebe78215 100644 --- a/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/sftp/SftpFileClient.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/sftp/SftpFileClient.java @@ -1,9 +1,9 @@ -package cn.iocoder.yudao.framework.file.core.client.sftp; +package cn.iocoder.yudao.module.infra.framework.file.core.client.sftp; import cn.hutool.core.io.FileUtil; import cn.hutool.extra.ssh.Sftp; import cn.iocoder.yudao.framework.common.util.io.FileUtils; -import cn.iocoder.yudao.framework.file.core.client.AbstractFileClient; +import cn.iocoder.yudao.module.infra.framework.file.core.client.AbstractFileClient; import java.io.File; diff --git a/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/sftp/SftpFileClientConfig.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/sftp/SftpFileClientConfig.java similarity index 86% rename from yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/sftp/SftpFileClientConfig.java rename to yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/sftp/SftpFileClientConfig.java index eea59243a..915c66076 100644 --- a/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/client/sftp/SftpFileClientConfig.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/client/sftp/SftpFileClientConfig.java @@ -1,11 +1,10 @@ -package cn.iocoder.yudao.framework.file.core.client.sftp; - -import cn.iocoder.yudao.framework.file.core.client.FileClientConfig; -import lombok.Data; -import org.hibernate.validator.constraints.URL; +package cn.iocoder.yudao.module.infra.framework.file.core.client.sftp; +import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClientConfig; import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.NotNull; +import lombok.Data; +import org.hibernate.validator.constraints.URL; /** * Sftp 文件客户端的配置类 diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/enums/FileStorageEnum.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/enums/FileStorageEnum.java new file mode 100644 index 000000000..866c43b65 --- /dev/null +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/enums/FileStorageEnum.java @@ -0,0 +1,55 @@ +package cn.iocoder.yudao.module.infra.framework.file.core.enums; + +import cn.hutool.core.util.ArrayUtil; +import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClient; +import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClientConfig; +import cn.iocoder.yudao.module.infra.framework.file.core.client.db.DBFileClient; +import cn.iocoder.yudao.module.infra.framework.file.core.client.db.DBFileClientConfig; +import cn.iocoder.yudao.module.infra.framework.file.core.client.ftp.FtpFileClient; +import cn.iocoder.yudao.module.infra.framework.file.core.client.ftp.FtpFileClientConfig; +import cn.iocoder.yudao.module.infra.framework.file.core.client.local.LocalFileClient; +import cn.iocoder.yudao.module.infra.framework.file.core.client.local.LocalFileClientConfig; +import cn.iocoder.yudao.module.infra.framework.file.core.client.s3.S3FileClient; +import cn.iocoder.yudao.module.infra.framework.file.core.client.s3.S3FileClientConfig; +import cn.iocoder.yudao.module.infra.framework.file.core.client.sftp.SftpFileClient; +import cn.iocoder.yudao.module.infra.framework.file.core.client.sftp.SftpFileClientConfig; +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 文件存储器枚举 + * + * @author 芋道源码 + */ +@AllArgsConstructor +@Getter +public enum FileStorageEnum { + + DB(1, DBFileClientConfig.class, DBFileClient.class), + + LOCAL(10, LocalFileClientConfig.class, LocalFileClient.class), + FTP(11, FtpFileClientConfig.class, FtpFileClient.class), + SFTP(12, SftpFileClientConfig.class, SftpFileClient.class), + + S3(20, S3FileClientConfig.class, S3FileClient.class), + ; + + /** + * 存储器 + */ + private final Integer storage; + + /** + * 配置类 + */ + private final Class configClass; + /** + * 客户端类 + */ + private final Class clientClass; + + public static FileStorageEnum getByStorage(Integer storage) { + return ArrayUtil.firstMatch(o -> o.getStorage().equals(storage), values()); + } + +} diff --git a/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/utils/FileTypeUtils.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/utils/FileTypeUtils.java similarity index 95% rename from yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/utils/FileTypeUtils.java rename to yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/utils/FileTypeUtils.java index 8b99227b1..ea71f5881 100644 --- a/yudao-framework/yudao-spring-boot-starter-file/src/main/java/cn/iocoder/yudao/framework/file/core/utils/FileTypeUtils.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/utils/FileTypeUtils.java @@ -1,4 +1,4 @@ -package cn.iocoder.yudao.framework.file.core.utils; +package cn.iocoder.yudao.module.infra.framework.file.core.utils; import com.alibaba.ttl.TransmittableThreadLocal; import lombok.SneakyThrows; diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/package-info.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/package-info.java new file mode 100644 index 000000000..04b68677b --- /dev/null +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/file/package-info.java @@ -0,0 +1,12 @@ +/** + * 文件客户端,支持多种存储器 + * + * 1. local:本地磁盘 + * 2. ftp:FTP 服务器 + * 3. sftp:SFTP 服务器 + * 4. db:数据库 + * 5. s3:支持 S3 协议的云存储服务,例如说 MinIO、阿里云、华为云、腾讯云、七牛云等等 + * + * @author 芋道源码 + */ +package cn.iocoder.yudao.module.infra.framework.file; \ No newline at end of file diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileConfigService.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileConfigService.java index 0019915ba..e1dfae452 100755 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileConfigService.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileConfigService.java @@ -1,11 +1,11 @@ package cn.iocoder.yudao.module.infra.service.file; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.framework.file.core.client.FileClient; import cn.iocoder.yudao.module.infra.controller.admin.file.vo.config.FileConfigPageReqVO; import cn.iocoder.yudao.module.infra.controller.admin.file.vo.config.FileConfigSaveReqVO; import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileConfigDO; +import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClient; import jakarta.validation.Valid; /** diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileConfigServiceImpl.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileConfigServiceImpl.java index eda97bf0b..710da1cdb 100755 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileConfigServiceImpl.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileConfigServiceImpl.java @@ -5,15 +5,15 @@ import cn.hutool.core.util.IdUtil; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.json.JsonUtils; import cn.iocoder.yudao.framework.common.util.validation.ValidationUtils; -import cn.iocoder.yudao.framework.file.core.client.FileClient; -import cn.iocoder.yudao.framework.file.core.client.FileClientConfig; -import cn.iocoder.yudao.framework.file.core.client.FileClientFactory; -import cn.iocoder.yudao.framework.file.core.enums.FileStorageEnum; import cn.iocoder.yudao.module.infra.controller.admin.file.vo.config.FileConfigPageReqVO; import cn.iocoder.yudao.module.infra.controller.admin.file.vo.config.FileConfigSaveReqVO; import cn.iocoder.yudao.module.infra.convert.file.FileConfigConvert; import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileConfigDO; import cn.iocoder.yudao.module.infra.dal.mysql.file.FileConfigMapper; +import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClient; +import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClientConfig; +import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClientFactory; +import cn.iocoder.yudao.module.infra.framework.file.core.enums.FileStorageEnum; import com.google.common.cache.CacheLoader; import com.google.common.cache.LoadingCache; import lombok.Getter; diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileServiceImpl.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileServiceImpl.java index f7c4b0b8e..88fbe386f 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileServiceImpl.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileServiceImpl.java @@ -5,14 +5,14 @@ import cn.hutool.core.util.StrUtil; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.io.FileUtils; import cn.iocoder.yudao.framework.common.util.object.BeanUtils; -import cn.iocoder.yudao.framework.file.core.client.FileClient; -import cn.iocoder.yudao.framework.file.core.client.s3.FilePresignedUrlRespDTO; -import cn.iocoder.yudao.framework.file.core.utils.FileTypeUtils; import cn.iocoder.yudao.module.infra.controller.admin.file.vo.file.FileCreateReqVO; import cn.iocoder.yudao.module.infra.controller.admin.file.vo.file.FilePageReqVO; import cn.iocoder.yudao.module.infra.controller.admin.file.vo.file.FilePresignedUrlRespVO; import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileDO; import cn.iocoder.yudao.module.infra.dal.mysql.file.FileMapper; +import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClient; +import cn.iocoder.yudao.module.infra.framework.file.core.client.s3.FilePresignedUrlRespDTO; +import cn.iocoder.yudao.module.infra.framework.file.core.utils.FileTypeUtils; import jakarta.annotation.Resource; import lombok.SneakyThrows; import org.springframework.stereotype.Service; diff --git a/yudao-framework/yudao-spring-boot-starter-file/src/test/java/cn/iocoder/yudao/framework/file/core/client/ftp/FtpFileClientTest.java b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/framework/file/core/ftp/FtpFileClientTest.java similarity index 83% rename from yudao-framework/yudao-spring-boot-starter-file/src/test/java/cn/iocoder/yudao/framework/file/core/client/ftp/FtpFileClientTest.java rename to yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/framework/file/core/ftp/FtpFileClientTest.java index 619e52db8..b8876f7fc 100644 --- a/yudao-framework/yudao-spring-boot-starter-file/src/test/java/cn/iocoder/yudao/framework/file/core/client/ftp/FtpFileClientTest.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/framework/file/core/ftp/FtpFileClientTest.java @@ -1,8 +1,10 @@ -package cn.iocoder.yudao.framework.file.core.client.ftp; +package cn.iocoder.yudao.module.infra.framework.file.core.ftp; import cn.hutool.core.io.resource.ResourceUtil; import cn.hutool.core.util.IdUtil; import cn.hutool.extra.ftp.FtpMode; +import cn.iocoder.yudao.module.infra.framework.file.core.client.ftp.FtpFileClient; +import cn.iocoder.yudao.module.infra.framework.file.core.client.ftp.FtpFileClientConfig; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; diff --git a/yudao-framework/yudao-spring-boot-starter-file/src/test/java/cn/iocoder/yudao/framework/file/core/client/local/LocalFileClientTest.java b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/framework/file/core/local/LocalFileClientTest.java similarity index 77% rename from yudao-framework/yudao-spring-boot-starter-file/src/test/java/cn/iocoder/yudao/framework/file/core/client/local/LocalFileClientTest.java rename to yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/framework/file/core/local/LocalFileClientTest.java index d48609bc6..7c622a530 100644 --- a/yudao-framework/yudao-spring-boot-starter-file/src/test/java/cn/iocoder/yudao/framework/file/core/client/local/LocalFileClientTest.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/framework/file/core/local/LocalFileClientTest.java @@ -1,7 +1,9 @@ -package cn.iocoder.yudao.framework.file.core.client.local; +package cn.iocoder.yudao.module.infra.framework.file.core.local; import cn.hutool.core.io.resource.ResourceUtil; import cn.hutool.core.util.IdUtil; +import cn.iocoder.yudao.module.infra.framework.file.core.client.local.LocalFileClient; +import cn.iocoder.yudao.module.infra.framework.file.core.client.local.LocalFileClientConfig; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; diff --git a/yudao-framework/yudao-spring-boot-starter-file/src/test/java/cn/iocoder/yudao/framework/file/core/client/s3/S3FileClientTest.java b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/framework/file/core/s3/S3FileClientTest.java similarity index 95% rename from yudao-framework/yudao-spring-boot-starter-file/src/test/java/cn/iocoder/yudao/framework/file/core/client/s3/S3FileClientTest.java rename to yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/framework/file/core/s3/S3FileClientTest.java index cbd41ab3e..3c40ce23e 100644 --- a/yudao-framework/yudao-spring-boot-starter-file/src/test/java/cn/iocoder/yudao/framework/file/core/client/s3/S3FileClientTest.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/framework/file/core/s3/S3FileClientTest.java @@ -1,13 +1,14 @@ -package cn.iocoder.yudao.framework.file.core.client.s3; +package cn.iocoder.yudao.module.infra.framework.file.core.s3; import cn.hutool.core.io.resource.ResourceUtil; import cn.hutool.core.util.IdUtil; import cn.iocoder.yudao.framework.common.util.validation.ValidationUtils; +import cn.iocoder.yudao.module.infra.framework.file.core.client.s3.S3FileClient; +import cn.iocoder.yudao.module.infra.framework.file.core.client.s3.S3FileClientConfig; +import jakarta.validation.Validation; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; -import jakarta.validation.Validation; - public class S3FileClientTest { @Test diff --git a/yudao-framework/yudao-spring-boot-starter-file/src/test/java/cn/iocoder/yudao/framework/file/core/client/sftp/SftpFileClientTest.java b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/framework/file/core/sftp/SftpFileClientTest.java similarity index 82% rename from yudao-framework/yudao-spring-boot-starter-file/src/test/java/cn/iocoder/yudao/framework/file/core/client/sftp/SftpFileClientTest.java rename to yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/framework/file/core/sftp/SftpFileClientTest.java index 4785c0d89..1e00cf196 100644 --- a/yudao-framework/yudao-spring-boot-starter-file/src/test/java/cn/iocoder/yudao/framework/file/core/client/sftp/SftpFileClientTest.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/framework/file/core/sftp/SftpFileClientTest.java @@ -1,7 +1,9 @@ -package cn.iocoder.yudao.framework.file.core.client.sftp; +package cn.iocoder.yudao.module.infra.framework.file.core.sftp; import cn.hutool.core.io.resource.ResourceUtil; import cn.hutool.core.util.IdUtil; +import cn.iocoder.yudao.module.infra.framework.file.core.client.sftp.SftpFileClient; +import cn.iocoder.yudao.module.infra.framework.file.core.client.sftp.SftpFileClientConfig; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; diff --git a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/file/FileConfigServiceImplTest.java b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/file/FileConfigServiceImplTest.java index 7f4322570..099dbdada 100755 --- a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/file/FileConfigServiceImplTest.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/file/FileConfigServiceImplTest.java @@ -4,17 +4,17 @@ import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.LocalDateTimeUtil; import cn.hutool.core.map.MapUtil; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.framework.file.core.client.FileClient; -import cn.iocoder.yudao.framework.file.core.client.FileClientConfig; -import cn.iocoder.yudao.framework.file.core.client.FileClientFactory; -import cn.iocoder.yudao.framework.file.core.client.local.LocalFileClient; -import cn.iocoder.yudao.framework.file.core.client.local.LocalFileClientConfig; -import cn.iocoder.yudao.framework.file.core.enums.FileStorageEnum; import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; import cn.iocoder.yudao.module.infra.controller.admin.file.vo.config.FileConfigPageReqVO; import cn.iocoder.yudao.module.infra.controller.admin.file.vo.config.FileConfigSaveReqVO; import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileConfigDO; import cn.iocoder.yudao.module.infra.dal.mysql.file.FileConfigMapper; +import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClient; +import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClientConfig; +import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClientFactory; +import cn.iocoder.yudao.module.infra.framework.file.core.client.local.LocalFileClient; +import cn.iocoder.yudao.module.infra.framework.file.core.client.local.LocalFileClientConfig; +import cn.iocoder.yudao.module.infra.framework.file.core.enums.FileStorageEnum; import lombok.Data; import org.junit.jupiter.api.Test; import org.springframework.boot.test.mock.mockito.MockBean; diff --git a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/file/FileServiceImplTest.java b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/file/FileServiceImplTest.java index 4cceb373e..4bf393e57 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/file/FileServiceImplTest.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/file/FileServiceImplTest.java @@ -3,12 +3,12 @@ package cn.iocoder.yudao.module.infra.service.file; import cn.hutool.core.io.resource.ResourceUtil; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.object.ObjectUtils; -import cn.iocoder.yudao.framework.file.core.client.FileClient; import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; import cn.iocoder.yudao.framework.test.core.util.AssertUtils; import cn.iocoder.yudao.module.infra.controller.admin.file.vo.file.FilePageReqVO; import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileDO; import cn.iocoder.yudao.module.infra.dal.mysql.file.FileMapper; +import cn.iocoder.yudao.module.infra.framework.file.core.client.FileClient; import org.junit.jupiter.api.Test; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.context.annotation.Import;