dev add config for nginx
Test Workflow / test (push) Successful in 2s

This commit is contained in:
vladp
2026-03-11 15:42:06 +07:00
parent 7fb96d4b51
commit b04a357cca
3 changed files with 9 additions and 3 deletions
@@ -1,6 +1,7 @@
package ru.soune.nocopy.service.violation;
import lombok.AllArgsConstructor;
import org.apache.commons.codec.digest.DigestUtils;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
@@ -27,8 +28,9 @@ public class ViolationService {
public void processViolation(YandexSearchResponse.ImageResult imageResult, FileEntity file,
GlobalSearchResult result) {
String url = imageResult.getUrl();
String urlHash = DigestUtils.sha256Hex(url);
if (!violationRepository.existsByUrl(url)) {
if (!violationRepository.existsByUrlHash(urlHash)) {
Violation violation = new Violation();
if (result != null) {
@@ -37,6 +39,7 @@ public class ViolationService {
violation.setHost(imageResult.getHost());
violation.setUrl(url);
violation.setUrlHash(urlHash);
violation.setPageUrl(imageResult.getPageUrl());
violation.setPageTitle(imageResult.getPageTitle());
violation.setFileEntity(file);