From f671ec40e959072f46adeea9d0a5519a2d82b1b2 Mon Sep 17 00:00:00 2001 From: Yann <1319542051@qq.com> Date: Mon, 24 Nov 2025 09:29:53 +0800 Subject: [PATCH 1/6] =?UTF-8?q?update=20configuration=E4=B8=ADprefix?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fs/framework/preview/office/JodConverterConfiguration.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs-framework/fs-preview/src/main/java/com/xddcodec/fs/framework/preview/office/JodConverterConfiguration.java b/fs-framework/fs-preview/src/main/java/com/xddcodec/fs/framework/preview/office/JodConverterConfiguration.java index 9b1155bc..49be786b 100644 --- a/fs-framework/fs-preview/src/main/java/com/xddcodec/fs/framework/preview/office/JodConverterConfiguration.java +++ b/fs-framework/fs-preview/src/main/java/com/xddcodec/fs/framework/preview/office/JodConverterConfiguration.java @@ -14,7 +14,7 @@ import java.io.File; @Slf4j @Configuration @RequiredArgsConstructor -@ConditionalOnProperty(prefix = "file.preview.office", name = "enabled", havingValue = "true", matchIfMissing = true) +@ConditionalOnProperty(prefix = "fs.preview.office", name = "enabled", havingValue = "true", matchIfMissing = true) public class JodConverterConfiguration { private final OfficeToPdfConfig config; -- Gitee From fafdef3aebfff679b6f3e582bb81f275f24ecf76 Mon Sep 17 00:00:00 2001 From: Yann <1319542051@qq.com> Date: Mon, 24 Nov 2025 15:43:14 +0800 Subject: [PATCH 2/6] =?UTF-8?q?update=20=E5=BC=80=E5=85=B3=E6=8E=A7?= =?UTF-8?q?=E5=88=B6office=E6=8F=92=E4=BB=B6=E9=A2=84=E8=A7=88=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E7=B1=BB=E6=B3=A8=E5=85=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../preview/converter/impl/OfficeToPdfConverter.java | 2 -- .../preview/office/JodConverterConfiguration.java | 12 ++++++++++++ .../preview/strategy/impl/OfficePreviewStrategy.java | 2 -- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/fs-framework/fs-preview/src/main/java/com/xddcodec/fs/framework/preview/converter/impl/OfficeToPdfConverter.java b/fs-framework/fs-preview/src/main/java/com/xddcodec/fs/framework/preview/converter/impl/OfficeToPdfConverter.java index 330dc63b..32b3d5f6 100644 --- a/fs-framework/fs-preview/src/main/java/com/xddcodec/fs/framework/preview/converter/impl/OfficeToPdfConverter.java +++ b/fs-framework/fs-preview/src/main/java/com/xddcodec/fs/framework/preview/converter/impl/OfficeToPdfConverter.java @@ -8,7 +8,6 @@ import org.jodconverter.core.DocumentConverter; import org.jodconverter.core.office.OfficeException; import org.jodconverter.core.office.OfficeManager; import org.jodconverter.local.LocalConverter; -import org.springframework.stereotype.Component; import java.io.ByteArrayInputStream; import java.io.IOException; @@ -19,7 +18,6 @@ import java.nio.file.Path; import java.util.UUID; @Slf4j -@Component @RequiredArgsConstructor public class OfficeToPdfConverter implements IConverter { diff --git a/fs-framework/fs-preview/src/main/java/com/xddcodec/fs/framework/preview/office/JodConverterConfiguration.java b/fs-framework/fs-preview/src/main/java/com/xddcodec/fs/framework/preview/office/JodConverterConfiguration.java index 49be786b..7ffbe548 100644 --- a/fs-framework/fs-preview/src/main/java/com/xddcodec/fs/framework/preview/office/JodConverterConfiguration.java +++ b/fs-framework/fs-preview/src/main/java/com/xddcodec/fs/framework/preview/office/JodConverterConfiguration.java @@ -1,5 +1,7 @@ package com.xddcodec.fs.framework.preview.office; +import com.xddcodec.fs.framework.preview.converter.impl.OfficeToPdfConverter; +import com.xddcodec.fs.framework.preview.strategy.impl.OfficePreviewStrategy; import jakarta.annotation.PreDestroy; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -51,6 +53,16 @@ public class JodConverterConfiguration { return officeManager; } + @Bean + public OfficeToPdfConverter officeToPdfConverter(OfficeManager officeManager, OfficeToPdfConfig config) { + return new OfficeToPdfConverter(officeManager, config); + } + + @Bean + public OfficePreviewStrategy officePreviewStrategy(OfficeToPdfConverter officeToPdfConverter) { + return new OfficePreviewStrategy(officeToPdfConverter); + } + /** * 确保项目关闭时,LibreOffice 也能关闭 */ diff --git a/fs-framework/fs-preview/src/main/java/com/xddcodec/fs/framework/preview/strategy/impl/OfficePreviewStrategy.java b/fs-framework/fs-preview/src/main/java/com/xddcodec/fs/framework/preview/strategy/impl/OfficePreviewStrategy.java index c4b94240..61a19059 100644 --- a/fs-framework/fs-preview/src/main/java/com/xddcodec/fs/framework/preview/strategy/impl/OfficePreviewStrategy.java +++ b/fs-framework/fs-preview/src/main/java/com/xddcodec/fs/framework/preview/strategy/impl/OfficePreviewStrategy.java @@ -8,11 +8,9 @@ import com.xddcodec.fs.framework.preview.core.PreviewContext; import com.xddcodec.fs.framework.preview.strategy.AbstractPreviewStrategy; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Component; import org.springframework.ui.Model; @Slf4j -@Component @RequiredArgsConstructor public class OfficePreviewStrategy extends AbstractPreviewStrategy { -- Gitee From 82a61376be082bfaa50fb6936900db71c2b2ff50 Mon Sep 17 00:00:00 2001 From: Yann <1319542051@qq.com> Date: Mon, 24 Nov 2025 17:48:11 +0800 Subject: [PATCH 3/6] =?UTF-8?q?update=20=E4=BC=A0=E8=BE=93vo=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/xddcodec/fs/file/domain/vo/FileTransferTaskVO.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fs-modules/fs-file/src/main/java/com/xddcodec/fs/file/domain/vo/FileTransferTaskVO.java b/fs-modules/fs-file/src/main/java/com/xddcodec/fs/file/domain/vo/FileTransferTaskVO.java index 69af7efa..7ff69dec 100644 --- a/fs-modules/fs-file/src/main/java/com/xddcodec/fs/file/domain/vo/FileTransferTaskVO.java +++ b/fs-modules/fs-file/src/main/java/com/xddcodec/fs/file/domain/vo/FileTransferTaskVO.java @@ -3,6 +3,7 @@ package com.xddcodec.fs.file.domain.vo; import com.fasterxml.jackson.annotation.JsonFormat; import com.xddcodec.fs.file.domain.FileTransferTask; import com.xddcodec.fs.file.enums.TransferTaskStatus; +import com.xddcodec.fs.file.enums.TransferTaskType; import com.xddcodec.fs.framework.common.utils.DateUtils; import io.github.linpeilie.annotations.AutoMapper; import lombok.Data; @@ -22,6 +23,10 @@ public class FileTransferTaskVO implements Serializable { * 任务ID */ private String taskId; + /** + * 任务类型 + */ + private TransferTaskType taskType; /** * 用户ID */ -- Gitee From 70118c2c7a9ec5c3ccfc26cc3684098d1b1dabf3 Mon Sep 17 00:00:00 2001 From: Yann <1319542051@qq.com> Date: Tue, 25 Nov 2025 09:36:54 +0800 Subject: [PATCH 4/6] =?UTF-8?q?update=20=E4=B8=8D=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E9=A2=84=E8=A7=88=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/preview/unsupported.html | 161 ++++++++++++++++++ 1 file changed, 161 insertions(+) diff --git a/fs-framework/fs-preview/src/main/resources/templates/preview/unsupported.html b/fs-framework/fs-preview/src/main/resources/templates/preview/unsupported.html index e69de29b..cb3724dd 100644 --- a/fs-framework/fs-preview/src/main/resources/templates/preview/unsupported.html +++ b/fs-framework/fs-preview/src/main/resources/templates/preview/unsupported.html @@ -0,0 +1,161 @@ + + +
+ + +
+ 文件 无法在线打开。
+ 您可以下载文件到本地进行查看。
+