Compare commits
9
Commits
NCBACK-25
...
69a79b7ac7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
69a79b7ac7 | ||
|
|
c97f205a17 | ||
|
|
85449d73fd | ||
|
|
859239e77a | ||
|
|
8d026a485f | ||
|
|
204e13ca85 | ||
|
|
79b13731a6 | ||
|
|
4314032a3b | ||
|
|
c2a780db2d |
@@ -0,0 +1,26 @@
|
||||
plugins {
|
||||
kotlin("jvm") version "2.1.10"
|
||||
}
|
||||
|
||||
group = "ru.soune"
|
||||
version = "1.0.0"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.10.2")
|
||||
|
||||
implementation("io.insert-koin:koin-core:4.1.1")
|
||||
implementation("io.insert-koin:koin-core-jvm:4.1.1")
|
||||
}
|
||||
|
||||
tasks.test {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
kotlin {
|
||||
jvmToolchain(21)
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package ru.soune
|
||||
|
||||
fun main() {
|
||||
println("Hello World!")
|
||||
}
|
||||
@@ -1 +1,6 @@
|
||||
plugins {
|
||||
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0'
|
||||
}
|
||||
rootProject.name = 'no-copy'
|
||||
include 'referral'
|
||||
|
||||
|
||||
@@ -155,10 +155,10 @@ public class ApiController {
|
||||
|
||||
if (similarFiles.isEmpty()) {
|
||||
messageDesc = MessageCode.FILE_NOT_FOUND.getDescription();
|
||||
success = MessageCode.FILE_NOT_FOUND;
|
||||
success = MessageCode.SUCCESS;
|
||||
} else {
|
||||
messageDesc = MessageCode.SIMILAR_FILES_FOUND.getDescription();
|
||||
success = MessageCode.SIMILAR_FILES_FOUND;
|
||||
success = MessageCode.SUCCESS;
|
||||
}
|
||||
|
||||
Map<String, Object> responseData = new HashMap<>();
|
||||
|
||||
@@ -3,7 +3,7 @@ package ru.soune.nocopy.repository;
|
||||
public interface SimilarImageProjection {
|
||||
Long getHash64Hi();
|
||||
Long getHash64Lo();
|
||||
String getFileId();
|
||||
String getId();
|
||||
Long getUserId();
|
||||
String getOriginalFileName();
|
||||
Long getFileSize();
|
||||
|
||||
@@ -54,7 +54,7 @@ public class FileSimilarityService {
|
||||
}
|
||||
|
||||
return SimilarFileDTO.builder()
|
||||
.fileId(c.getFileId())
|
||||
.fileId(c.getId())
|
||||
.originalFileName(c.getOriginalFileName())
|
||||
.fileSize(c.getFileSize())
|
||||
.hammingDistance(hamming)
|
||||
@@ -101,7 +101,7 @@ public class FileSimilarityService {
|
||||
}
|
||||
|
||||
return SimilarFileDTO.builder()
|
||||
.fileId(similarImageProjection.getFileId())
|
||||
.fileId(similarImageProjection.getId())
|
||||
.originalFileName(similarImageProjection.getOriginalFileName())
|
||||
.fileSize(similarImageProjection.getFileSize())
|
||||
.hammingDistance(hamming)
|
||||
@@ -170,7 +170,7 @@ public class FileSimilarityService {
|
||||
}
|
||||
|
||||
return SimilarFileDTO.builder()
|
||||
.fileId(similarImageProjection.getFileId())
|
||||
.fileId(similarImageProjection.getId())
|
||||
.originalFileName(similarImageProjection.getOriginalFileName())
|
||||
.fileSize(similarImageProjection.getFileSize())
|
||||
.hammingDistance(hamming)
|
||||
|
||||
@@ -59,7 +59,7 @@ public class FileEntityService {
|
||||
if (!duplicatedByHash.isEmpty()) {
|
||||
SimilarImageProjection similarImageProjection = duplicatedByHash.get(0);
|
||||
|
||||
throw new DuplicateImageException("Duplicate", similarImageProjection.getFileId(),
|
||||
throw new DuplicateImageException("Duplicate", similarImageProjection.getId(),
|
||||
similarImageProjection.getUserId());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -390,7 +390,7 @@ public class FileUploadServiceImpl implements FileUploadService {
|
||||
hash.get("hi"), hash.get("low"));
|
||||
|
||||
if (!duplicates.isEmpty()) {
|
||||
throw new DuplicateImageException("Duplicate", duplicates.get(0).getFileId(),
|
||||
throw new DuplicateImageException("Duplicate", duplicates.get(0).getId(),
|
||||
duplicates.get(0).getUserId());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user