临时授权下载接口-返回fileName
This commit is contained in:
parent
a936fb75be
commit
c20dbd6caa
@ -24,5 +24,9 @@ public class ApiSignUrlDownloadResponse {
|
|||||||
* 文件 Key
|
* 文件 Key
|
||||||
*/
|
*/
|
||||||
private String fileKey;
|
private String fileKey;
|
||||||
|
/**
|
||||||
|
* 文件名称
|
||||||
|
*/
|
||||||
|
private String fileName;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,4 +25,9 @@ public class SignUrlDownloadResponse {
|
|||||||
*/
|
*/
|
||||||
private String fileKey;
|
private String fileKey;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件名称
|
||||||
|
*/
|
||||||
|
private String fileName;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -896,12 +896,14 @@ public class FileServiceImpl implements FileService {
|
|||||||
return SignUrlDownloadResponse.builder()
|
return SignUrlDownloadResponse.builder()
|
||||||
.signUrl(url)
|
.signUrl(url)
|
||||||
.fileKey(item.getFileUuid())
|
.fileKey(item.getFileUuid())
|
||||||
|
.fileName(item.getFileName())
|
||||||
.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());
|
String signUrl = this.fileManager.signUrlDownload(item.getBucketName(), tgtFileKey, Objects.nonNull(expire) ? expire : SIGN_URL_DOWNLOAD_EXPIRE_SECOND , item.getChannelCode(), item.getFileName());
|
||||||
return SignUrlDownloadResponse.builder()
|
return SignUrlDownloadResponse.builder()
|
||||||
.signUrl(UrlUtil.httpToHttps(signUrl))
|
.signUrl(UrlUtil.httpToHttps(signUrl))
|
||||||
.fileKey(item.getFileUuid())
|
.fileKey(item.getFileUuid())
|
||||||
|
.fileName(item.getFileName())
|
||||||
.build();
|
.build();
|
||||||
default:
|
default:
|
||||||
BizException.error(CodeEnum.CHANNEL_TYPE_NOT_EXIST);
|
BizException.error(CodeEnum.CHANNEL_TYPE_NOT_EXIST);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user