This commit is contained in:
@@ -20,6 +20,7 @@ public class FileEntityResponse {
|
||||
private String storedFileName;
|
||||
private String filePath;
|
||||
private String protectedFilePath;
|
||||
private String thumbnailFileUrl;
|
||||
private Long fileSize;
|
||||
private String mimeType;
|
||||
private String fileExtension;
|
||||
|
||||
@@ -2,6 +2,7 @@ package ru.soune.nocopy.service.file;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ru.soune.nocopy.dto.file.FileEntityResponse;
|
||||
@@ -50,6 +51,9 @@ public class FileEntityService {
|
||||
|
||||
private final ImageResizeService imageResizeService;
|
||||
|
||||
@Value("${server.baseurl}")
|
||||
private String baseUrl;
|
||||
|
||||
@Transactional(noRollbackFor = DuplicateImageException.class)
|
||||
public FileEntity createFromUploadSession(FileUploadSession session, String checksum) {
|
||||
log.info("Creating FileEntity for upload session: {}", session.getUploadId());
|
||||
@@ -417,6 +421,7 @@ public class FileEntityService {
|
||||
.checksCount(0)
|
||||
.fileUploadDate(fileEntity.getCreatedAt())
|
||||
.protectedFilePath(fileEntity.getProtectedFilePath())
|
||||
.thumbnailFileUrl(baseUrl + "/api/files/protected/" + fileEntity.getId() + "/thumbnail")
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user