feat:(REQ-3560) 获取下载文件加上文件大小

This commit is contained in:
xudawei 2025-04-10 14:24:10 +08:00
parent 89a2ce5a5d
commit b7e4ccd258
3 changed files with 4 additions and 4 deletions

View File

@ -32,6 +32,6 @@ public class ApiSignUrlDownloadResponse {
/** /**
* 文件大小 * 文件大小
*/ */
private Long fileSize; private Long storageSize;
} }

View File

@ -33,6 +33,6 @@ public class SignUrlDownloadResponse {
/** /**
* 文件大小 * 文件大小
*/ */
private Long fileSize; private Long storageSize;
} }

View File

@ -981,7 +981,7 @@ public class FileServiceImpl implements FileService {
.signUrl(this.fileManager.buildPublicXImageProcess(url, style)) .signUrl(this.fileManager.buildPublicXImageProcess(url, style))
.fileKey(item.getFileUuid()) .fileKey(item.getFileUuid())
.fileName(item.getFileName()) .fileName(item.getFileName())
.fileSize(item.fetchFileSize()) .storageSize(item.fetchFileSize())
.build(); .build();
case PRIVATE_BUCKET://私有桶 - 临时授权链接 例如 http://xxx.png?Expire=a&AccessKeyId=b&Signature=c&repsonse-content-disposition=d case PRIVATE_BUCKET://私有桶 - 临时授权链接 例如 http://xxx.png?Expire=a&AccessKeyId=b&Signature=c&repsonse-content-disposition=d
String signUrl = this.fileManager.signUrlDownload(item.getBucketName(), tgtFileKey, Objects.nonNull(expire) ? expire : SIGN_URL_DOWNLOAD_EXPIRE_SECOND , item.getChannelCode(), item.getFileName(), style, hasFileName); String signUrl = this.fileManager.signUrlDownload(item.getBucketName(), tgtFileKey, Objects.nonNull(expire) ? expire : SIGN_URL_DOWNLOAD_EXPIRE_SECOND , item.getChannelCode(), item.getFileName(), style, hasFileName);
@ -989,7 +989,7 @@ public class FileServiceImpl implements FileService {
.signUrl(UrlUtil.httpToHttps(signUrl)) .signUrl(UrlUtil.httpToHttps(signUrl))
.fileKey(item.getFileUuid()) .fileKey(item.getFileUuid())
.fileName(item.getFileName()) .fileName(item.getFileName())
.fileSize(item.fetchFileSize()) .storageSize(item.fetchFileSize())
.build(); .build();
default: default:
BizException.error(CodeEnum.CHANNEL_TYPE_NOT_EXIST); BizException.error(CodeEnum.CHANNEL_TYPE_NOT_EXIST);