@@ -20,6 +20,7 @@ public interface ImageSimilarityRepository
|
||||
f.support_id AS supportId,
|
||||
f.created_at AS uploadDate,
|
||||
f.protection_status AS protectionStatus,
|
||||
f.file_extension AS extension,
|
||||
h.hash64_hi AS hash64Hi,
|
||||
h.hash64_lo AS hash64Lo
|
||||
FROM image_hashes ref
|
||||
@@ -43,6 +44,7 @@ public interface ImageSimilarityRepository
|
||||
f.support_id AS supportId,
|
||||
f.created_at AS uploadDate,
|
||||
f.protection_status AS protectionStatus,
|
||||
f.file_extension AS extension,
|
||||
h.hash64_hi AS hash64Hi,
|
||||
h.hash64_lo AS hash64Lo
|
||||
FROM image_hashes ref
|
||||
@@ -70,6 +72,7 @@ public interface ImageSimilarityRepository
|
||||
f.stored_file_name AS similarFileId,
|
||||
f.support_id AS supportId,
|
||||
f.created_at AS uploadDate,
|
||||
f.file_extension AS extension,
|
||||
f.protection_status AS protectionStatus
|
||||
FROM image_hashes h
|
||||
JOIN file_entities f ON f.id = h.file_id
|
||||
|
||||
@@ -14,4 +14,5 @@ public interface SimilarImageProjection {
|
||||
Long getSupportId();
|
||||
LocalDateTime getUploadDate();
|
||||
ProtectionStatus getProtectionStatus();
|
||||
String getExtension();
|
||||
}
|
||||
@@ -237,7 +237,9 @@ public class FileSimilarityService {
|
||||
return SimilarFileDTO.builder()
|
||||
.fileId(similarImageProjection.getId())
|
||||
.ownerId(similarImageProjection.getUserId())
|
||||
.originalFileName(similarImageProjection.getOriginalFileName())
|
||||
.originalFileName(similarImageProjection.getOriginalFileName().replace("." +
|
||||
similarImageProjection.getExtension(), "") + "_nocopy_protected" +
|
||||
"." + similarImageProjection.getExtension())
|
||||
.fileSize(similarImageProjection.getFileSize())
|
||||
.hammingDistance(hamming)
|
||||
.similarityLevel(level)
|
||||
@@ -252,7 +254,9 @@ public class FileSimilarityService {
|
||||
return SimilarFileDTO.builder()
|
||||
.fileId(fileEntity.getId())
|
||||
.ownerId(fileEntity.getUserId())
|
||||
.originalFileName(fileEntity.getOriginalFileName())
|
||||
.originalFileName(fileEntity.getOriginalFileName().replace("." +
|
||||
fileEntity.getFileExtension(), "") + "_nocopy_protected" +
|
||||
"." + fileEntity.getFileExtension())
|
||||
.fileSize(fileEntity.getFileSize())
|
||||
.uploadDate(fileEntity.getCreatedAt())
|
||||
.status(fileEntity.getProtectionStatus())
|
||||
|
||||
Reference in New Issue
Block a user