@@ -40,6 +40,8 @@ import java.nio.file.Paths;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
|
||||
import static java.awt.SystemColor.info;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@@ -164,20 +166,6 @@ public class ImageFoundRequestHandler implements RequestHandler {
|
||||
File file = tempFile.toFile();
|
||||
// String filePath = tempFile.toAbsolutePath().toString();
|
||||
NoCopyCheckResult checkResult = noCopyFileService.checkFile(file, FileProtector.Type.IMAGE);
|
||||
log.info("checkResult: " + checkResult);
|
||||
log.info("checkResult: " + checkResult);
|
||||
log.info("checkResult: " + checkResult);
|
||||
log.info("checkResult: " + checkResult);
|
||||
log.info("checkResult: " + checkResult);
|
||||
log.info("checkResult: " + checkResult);
|
||||
log.info("checkResult: " + checkResult);
|
||||
log.info("checkResult: " + checkResult);
|
||||
log.info("checkResult: " + checkResult);
|
||||
log.info("checkResult: " + checkResult);
|
||||
log.info("checkResult: " + checkResult);
|
||||
log.info("checkResult: " + checkResult);
|
||||
log.info("checkResult: " + checkResult);
|
||||
log.info("checkResult: " + checkResult);
|
||||
// Map<String, Long> hashSearchApiFile = imageHashService.calculateHash(Paths.get(filePath));
|
||||
// ImageHashEntity checkFileHash = imageHashRepository.findByFileId(fileId);
|
||||
|
||||
@@ -185,17 +173,10 @@ public class ImageFoundRequestHandler implements RequestHandler {
|
||||
// && hashSearchApiFile.get("low").equals(checkFileHash.getHash64Lo());
|
||||
switch (checkResult) {
|
||||
case ImageCheckResult.Success success -> {
|
||||
FileProtector.FileInfo info = success.getInfo();
|
||||
log.info("info: " + info);
|
||||
log.info("info: " + info);
|
||||
log.info("info: " + info);
|
||||
log.info("info: " + info);
|
||||
log.info("info: " + info);
|
||||
log.info("info: " + info);
|
||||
log.info("info: " + info);
|
||||
log.info("info: " + info);
|
||||
FileEntity entity = fileEntityRepository.findByFileId(info.getId());
|
||||
if (entity == null) {
|
||||
double watermarkCorrelation = success.getWatermarkCorrelation();
|
||||
log.info("watermarkCorrelation: " + watermarkCorrelation);
|
||||
|
||||
if (watermarkCorrelation < 50.0) {
|
||||
return new BaseResponse(request.getMsgId(), MessageCode.SUCCESS.getCode(),
|
||||
"Not found similar pictures", new YandexSearchResponse());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user