临时授权下载接口-返回fileName

This commit is contained in:
xudawei 2024-06-05 22:15:01 +08:00
parent a936fb75be
commit c20dbd6caa
3 changed files with 11 additions and 0 deletions

View File

@ -24,5 +24,9 @@ public class ApiSignUrlDownloadResponse {
* 文件 Key
*/
private String fileKey;
/**
* 文件名称
*/
private String fileName;
}

View File

@ -25,4 +25,9 @@ public class SignUrlDownloadResponse {
*/
private String fileKey;
/**
* 文件名称
*/
private String fileName;
}

View File

@ -896,12 +896,14 @@ public class FileServiceImpl implements FileService {
return SignUrlDownloadResponse.builder()
.signUrl(url)
.fileKey(item.getFileUuid())
.fileName(item.getFileName())
.build();
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());
return SignUrlDownloadResponse.builder()
.signUrl(UrlUtil.httpToHttps(signUrl))
.fileKey(item.getFileUuid())
.fileName(item.getFileName())
.build();
default:
BizException.error(CodeEnum.CHANNEL_TYPE_NOT_EXIST);