Merge branch 'feature/REQ-2322' into 'master'

Feature/req 2322

See merge request universal/infrastructure/backend/oss!146
This commit is contained in:
徐大伟 2024-06-19 05:40:42 +00:00
commit 3d26392123
3 changed files with 11 additions and 0 deletions

View File

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

View File

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

View File

@ -898,12 +898,14 @@ public class FileServiceImpl implements FileService {
return SignUrlDownloadResponse.builder() return SignUrlDownloadResponse.builder()
.signUrl(this.buildPublicXImageProcess(url, style)) .signUrl(this.buildPublicXImageProcess(url, style))
.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(), 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);
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);