优化调整

This commit is contained in:
tianliyong 2023-08-24 14:21:54 +08:00
parent 88e98f09f6
commit 045910da80

View File

@ -184,7 +184,7 @@ public class FileServiceImpl implements FileService {
@Override @Override
public FileInformationResponse multipartUploadFile(MultipartUploadFileDto dto) { public FileInformationResponse multipartUploadFile(MultipartUploadFileDto dto) {
File ossFile = multipartUploadAndGetFile(dto); File ossFile = multipartUploadAndGetFile(dto);
return setFileInfoResp(ossFile); return setFileInfoResp(dto.getFile().getSize(), ossFile);
} }
private File multipartUploadAndGetFile(MultipartUploadFileDto dto) { private File multipartUploadAndGetFile(MultipartUploadFileDto dto) {
@ -603,4 +603,14 @@ public class FileServiceImpl implements FileService {
return resp; return resp;
} }
private FileInformationResponse setFileInfoResp(long fileSize, File ossFile) {
FileInformationResponse resp = new FileInformationResponse();
resp.setUrl(ossFile.getFileUrl());
resp.setFileName(ossFile.getFileName());
resp.setUrlMd5(ossFile.getUrlMd5());
resp.setFileKey(ossFile.getFileUuid());
resp.setFileSize(fileSize);
return resp;
}
} }