Merge pull request 'NCBACK-3' (#14) from NCBACK-3 into dev
Test Workflow / test (push) Successful in 3s
Test Workflow / test (push) Successful in 3s
Reviewed-on: #14
This commit was merged in pull request #14.
This commit is contained in:
+4
-2
@@ -65,9 +65,11 @@ services:
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_PORT: 5432
|
||||
POSTGRES_HOST: db
|
||||
YANDEX_SEARCH_API_KEY: AQVNyaVaUmgUb1GMCtf5zSEqFxy0woXrcMOOB43q
|
||||
YANDEX_SEARCH_FOLDER_ID: b1gokpdbm6qfpsou8pcd
|
||||
YANDEX_API_KEY: AQVNyaVaUmgUb1GMCtf5zSEqFxy0woXrcMOOB43q
|
||||
YANDEX_FOLDER_ID: b1gokpdbm6qfpsou8pcd
|
||||
YANDEX_SEARCH_URL: "https://searchapi.api.cloud.yandex.net/v2/image/search_by_image"
|
||||
STORAGE_SERVICE_URL: http://storage:8081
|
||||
SPRING_PROFILES_ACTIVE: docker
|
||||
depends_on:
|
||||
- db
|
||||
ports:
|
||||
|
||||
@@ -3,6 +3,7 @@ package ru.soune.nocopy.handler;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import ru.soune.nocopy.dto.BaseRequest;
|
||||
import ru.soune.nocopy.dto.BaseResponse;
|
||||
@@ -18,6 +19,7 @@ public class ImageFoundRequestHandler implements RequestHandler {
|
||||
|
||||
private final ObjectMapper objectMapper;
|
||||
|
||||
@Autowired
|
||||
private final YandexSearchService yandexSearchService;
|
||||
|
||||
@Override
|
||||
|
||||
@@ -32,13 +32,13 @@ public class YandexSearchService {
|
||||
private final FileEntityRepository fileEntityRepository;
|
||||
private final ObjectMapper objectMapper;
|
||||
|
||||
@Value("${yandex.api-key}")
|
||||
@Value("${YANDEX_API_KEY}")
|
||||
private String apiKey;
|
||||
|
||||
@Value("${yandex.folder-id}")
|
||||
@Value("${YANDEX_FOLDER_ID}")
|
||||
private String folderId;
|
||||
|
||||
@Value("${yandex.search-url}")
|
||||
@Value("${YANDEX_SEARCH_URL}")
|
||||
private String searchUrl;
|
||||
|
||||
@PostConstruct
|
||||
|
||||
@@ -40,11 +40,6 @@ security:
|
||||
allowed-headers: "*"
|
||||
allow-credentials: true
|
||||
|
||||
yandex:
|
||||
api-key: ${YANDEX_SEARCH_API_KEY}
|
||||
folder-id: ${YANDEX_SEARCH_FOLDER_ID}
|
||||
search-url: "https://searchapi.api.cloud.yandex.net/v2/image/search_by_image"
|
||||
|
||||
server:
|
||||
port: ${SERVER_PORT:8080}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user