diff --git a/src/main/java/org/folio/client/feign/SearchClient.java b/src/main/java/org/folio/client/feign/SearchClient.java index 7cffc87c..c5158c2f 100644 --- a/src/main/java/org/folio/client/feign/SearchClient.java +++ b/src/main/java/org/folio/client/feign/SearchClient.java @@ -13,7 +13,7 @@ public interface SearchClient { @GetMapping("/instances") - ResultList searchInstances(@RequestParam("query") CqlQuery cql); + ResultList searchInstances(@RequestParam("query") CqlQuery cql, @RequestParam("expandAll") Boolean expandAll); @Data @JsonIgnoreProperties(ignoreUnknown = true) diff --git a/src/main/java/org/folio/service/SearchService.java b/src/main/java/org/folio/service/SearchService.java deleted file mode 100644 index 44380f6c..00000000 --- a/src/main/java/org/folio/service/SearchService.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.folio.service; - -import java.util.List; -import java.util.Optional; -import java.util.UUID; - -public interface SearchService { - Optional> getTenantsByInstanceId(UUID instanceId); -} diff --git a/src/main/java/org/folio/service/impl/SearchServiceImpl.java b/src/main/java/org/folio/service/impl/SearchServiceImpl.java deleted file mode 100644 index 7e95fc4b..00000000 --- a/src/main/java/org/folio/service/impl/SearchServiceImpl.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.folio.service.impl; - -import lombok.RequiredArgsConstructor; -import org.folio.client.feign.SearchClient; -import org.folio.service.SearchService; -import org.springframework.stereotype.Service; -import java.util.List; -import java.util.Optional; -import java.util.UUID; - -import static org.folio.support.CqlQuery.exactMatch; - -@Service -@RequiredArgsConstructor -public class SearchServiceImpl implements SearchService { - - private final SearchClient searchClient; - @Override - public Optional> getTenantsByInstanceId(UUID instanceId) { - var resultList = searchClient.searchInstances(exactMatch("id", instanceId.toString())); - if(resultList.getTotalRecords() > 0) { - return Optional.of(resultList.getResult().stream().map(SearchClient.Instance::getId).toList()); - } - return Optional.empty(); - } -}