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