Merge branch 'dev' into NCBACK-33
# Conflicts: # src/main/java/ru/soune/nocopy/entity/file/ImageProtection.java # src/main/java/ru/soune/nocopy/entity/user/User.java # src/main/java/ru/soune/nocopy/handler/ImageFoundRequestHandler.java # src/main/java/ru/soune/nocopy/repository/AuthTokenRepository.java # src/main/java/ru/soune/nocopy/service/file/impl/FileUploadServiceImpl.java
This commit is contained in:
@@ -7,9 +7,12 @@ import org.springframework.stereotype.Component;
|
||||
import ru.soune.nocopy.dto.BaseRequest;
|
||||
import ru.soune.nocopy.dto.BaseResponse;
|
||||
import ru.soune.nocopy.dto.MessageCode;
|
||||
import ru.soune.nocopy.dto.file.GoogleVisionSearchResponse;
|
||||
import ru.soune.nocopy.dto.file.ImageSearchRequest;
|
||||
import ru.soune.nocopy.dto.file.YandexSearchResponse;
|
||||
import ru.soune.nocopy.service.search.YandexSearchService;
|
||||
import ru.soune.nocopy.service.GoogleVisionSearchService;
|
||||
import ru.soune.nocopy.service.YandexSearchService;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
@@ -20,6 +23,8 @@ public class ImageFoundRequestHandler implements RequestHandler {
|
||||
|
||||
private final YandexSearchService yandexSearchService;
|
||||
|
||||
private final GoogleVisionSearchService googleVisionSearchService;
|
||||
|
||||
@Override
|
||||
public BaseResponse handle(BaseRequest request) throws Exception {
|
||||
ImageSearchRequest imageSearchRequest = objectMapper.convertValue(request.getMessageBody(),
|
||||
@@ -29,6 +34,9 @@ public class ImageFoundRequestHandler implements RequestHandler {
|
||||
|
||||
YandexSearchResponse response = yandexSearchService.searchByFileEntity(fileId);
|
||||
|
||||
//TODO uncommited when add billing
|
||||
// GoogleVisionSearchResponse googleVisionSearchResponse = googleVisionSearchService.searchByFileEntity(fileId);
|
||||
|
||||
return new BaseResponse(request.getMsgId(), MessageCode.SUCCESS.getCode(),
|
||||
MessageCode.SUCCESS.getDescription(), response);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user