1. 升级 3.0.39

新增 FileApi 获取到完整 fileDO 信息接口
This commit is contained in:
chenbowen
2025-09-26 11:41:38 +08:00
parent d2598bafc3
commit 9e485fa477
4 changed files with 118 additions and 18 deletions

View File

@@ -5,6 +5,7 @@ import cn.hutool.core.io.FileUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.digest.DigestUtil;
import com.google.common.annotations.VisibleForTesting;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.util.object.BeanUtils;
import com.zt.plat.module.infra.controller.admin.file.vo.file.FileCreateReqVO;
@@ -18,7 +19,6 @@ import com.zt.plat.module.infra.framework.file.core.client.FileClient;
import com.zt.plat.module.infra.framework.file.core.client.s3.FilePresignedUrlRespDTO;
import com.zt.plat.module.infra.framework.file.core.utils.FileTypeUtils;
import com.zt.plat.module.infra.util.VerificationCodeUtil;
import com.google.common.annotations.VisibleForTesting;
import jakarta.annotation.Resource;
import lombok.SneakyThrows;
import org.apache.commons.lang3.StringUtils;
@@ -122,7 +122,8 @@ public class FileServiceImpl implements FileService {
@SneakyThrows
public String createFile(byte[] content, String name, String directory, String type, Boolean encrypt) {
FileDO entity = uploadFile(content, name, directory, type, encrypt);
return entity.getUrl();
FileRespVO fileRespVO = BeanUtils.toBean(entity, FileRespVO.class);
return fileRespVO.getUrl();
}
@SneakyThrows