dev add check similar
Test Workflow / test (push) Has been cancelled

This commit is contained in:
2026-04-29 16:59:27 +07:00
parent 0f8017a5a9
commit f032caf0a3
3 changed files with 32 additions and 6 deletions
@@ -114,5 +114,29 @@ public interface ImageSimilarityRepository
List<SimilarImageProjection> findExactDuplicates(
@Param("hash64Hi") Long hash64_hi,
@Param("hash64Lo") Long hash64_lo);
@Query(value = """
SELECT
h.hash64_hi AS hash64Hi,
h.hash64_lo AS hash64Lo,
h.file_id AS fileId,
f.user_id AS userId,
f.original_file_name AS originalFileName,
f.file_size AS fileSize,
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
WHERE h.hash64_hi = :hash64Hi
AND h.hash64_lo = :hash64Lo
AND (f.status = 'TEMP')
""",
nativeQuery = true)
List<SimilarImageProjection> findExactDuplicatesTemp(
@Param("hash64Hi") Long hash64_hi,
@Param("hash64Lo") Long hash64_lo);
}