This commit is contained in:
+2
-1
@@ -34,7 +34,6 @@ dependencies {
|
|||||||
implementation 'org.mapstruct:mapstruct:1.5.5.Final'
|
implementation 'org.mapstruct:mapstruct:1.5.5.Final'
|
||||||
implementation 'commons-validator:commons-validator:1.7'
|
implementation 'commons-validator:commons-validator:1.7'
|
||||||
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-mail', version: '4.0.1'
|
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-mail', version: '4.0.1'
|
||||||
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.17.2'
|
|
||||||
implementation group: 'com.google.cloud', name: 'google-cloud-vision', version: '3.55.0'
|
implementation group: 'com.google.cloud', name: 'google-cloud-vision', version: '3.55.0'
|
||||||
implementation group: 'com.google.api-client', name: 'google-api-client', version: '2.7.2'
|
implementation group: 'com.google.api-client', name: 'google-api-client', version: '2.7.2'
|
||||||
|
|
||||||
@@ -42,6 +41,8 @@ dependencies {
|
|||||||
|
|
||||||
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.17.0'
|
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.17.0'
|
||||||
implementation 'tools.jackson.core:jackson-core:3.0.3'
|
implementation 'tools.jackson.core:jackson-core:3.0.3'
|
||||||
|
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.17.2'
|
||||||
|
|
||||||
implementation 'jakarta.xml.bind:jakarta.xml.bind-api:4.0.0'
|
implementation 'jakarta.xml.bind:jakarta.xml.bind-api:4.0.0'
|
||||||
|
|
||||||
annotationProcessor 'org.mapstruct:mapstruct-processor:1.5.5.Final'
|
annotationProcessor 'org.mapstruct:mapstruct-processor:1.5.5.Final'
|
||||||
|
|||||||
@@ -1,15 +1,21 @@
|
|||||||
package ru.soune.nocopy.kafka;
|
package ru.soune.nocopy.kafka;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.kafka.annotation.KafkaListener;
|
import org.springframework.kafka.annotation.KafkaListener;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
import ru.soune.nocopy.dto.file.YandexSearchResponse;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
@RequiredArgsConstructor
|
||||||
public class MonitoringResultListener {
|
public class MonitoringResultListener {
|
||||||
|
|
||||||
@KafkaListener(topics = "monitoring-results", groupId = "dashboard")
|
private final ObjectMapper objectMapper;
|
||||||
public void handleCommand(String commandMessage) {
|
|
||||||
log.info("Monitoring result: " + commandMessage);
|
// @KafkaListener(topics = "monitoring-results", groupId = "dashboard")
|
||||||
|
public void handleCommand(String message) {
|
||||||
|
YandexSearchResponse yandexSearchResponse = objectMapper.convertValue(message, YandexSearchResponse.class);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -119,7 +119,8 @@ public class MonitoringSearchService {
|
|||||||
monitoring.getFile(), "google_lens", "exact_matches");
|
monitoring.getFile(), "google_lens", "exact_matches");
|
||||||
|
|
||||||
List<YandexSearchResponse.ImageResult> googleImages =
|
List<YandexSearchResponse.ImageResult> googleImages =
|
||||||
searchImageService.getAllImagesWithoutPagination(googleResponse, "exact_matches");
|
searchImageService.getAllImagesWithoutPagination(googleResponse,
|
||||||
|
"exact_matches");
|
||||||
|
|
||||||
allResults.addAll(googleImages);
|
allResults.addAll(googleImages);
|
||||||
log.info("Google search found {} results", googleImages.size());
|
log.info("Google search found {} results", googleImages.size());
|
||||||
|
|||||||
@@ -1,4 +1,13 @@
|
|||||||
spring:
|
spring:
|
||||||
|
# kafka:
|
||||||
|
# bootstrap-servers: kafka:9092
|
||||||
|
# consumer:
|
||||||
|
# group-id: dashboard
|
||||||
|
# key-deserializer: org.apache.kafka.common.serialization.StringDeserializer
|
||||||
|
# value-deserializer: org.apache.kafka.common.serialization.StringDeserializer
|
||||||
|
# producer:
|
||||||
|
# key-serializer: org.apache.kafka.common.serialization.StringSerializer
|
||||||
|
# value-serializer: org.apache.kafka.common.serialization.StringSerializer
|
||||||
cloud:
|
cloud:
|
||||||
compatibility-verifier:
|
compatibility-verifier:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|||||||
Reference in New Issue
Block a user