From 4b6c5fb69e448c2548aa60e6b36675a010131f6c Mon Sep 17 00:00:00 2001 From: fengshuonan Date: Mon, 13 Nov 2023 17:53:50 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=908.0.3=E3=80=91=E3=80=90file=E3=80=91?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=96=87=E4=BB=B6=E8=AF=A6=E6=83=85=E7=9A=84?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=B8=B2=E6=9F=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/format/FileInfoFormatProcess.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 kernel-d-file/file-api/src/main/java/cn/stylefeng/roses/kernel/file/api/format/FileInfoFormatProcess.java diff --git a/kernel-d-file/file-api/src/main/java/cn/stylefeng/roses/kernel/file/api/format/FileInfoFormatProcess.java b/kernel-d-file/file-api/src/main/java/cn/stylefeng/roses/kernel/file/api/format/FileInfoFormatProcess.java new file mode 100644 index 000000000..a7906dcd8 --- /dev/null +++ b/kernel-d-file/file-api/src/main/java/cn/stylefeng/roses/kernel/file/api/format/FileInfoFormatProcess.java @@ -0,0 +1,27 @@ +package cn.stylefeng.roses.kernel.file.api.format; + +import cn.hutool.core.convert.Convert; +import cn.hutool.extra.spring.SpringUtil; +import cn.stylefeng.roses.kernel.file.api.FileInfoApi; +import cn.stylefeng.roses.kernel.rule.format.BaseSimpleFieldFormatProcess; + +/** + * 针对文件id的包装处理,返回文件可以访问的地址和文件的名称 + * + * @author fengshuonan + * @since 2023/11/13 17:49 + */ +public class FileInfoFormatProcess extends BaseSimpleFieldFormatProcess { + + @Override + public Class getItemClass() { + return Long.class; + } + + @Override + public Object simpleItemFormat(Object businessId) { + FileInfoApi fileInfoApi = SpringUtil.getBean(FileInfoApi.class); + return fileInfoApi.buildAntdvFileInfo(Convert.toLong(businessId)); + } + +}