Initial implementation

This commit is contained in:
2026-02-15 02:11:57 +05:00
commit 8c8d2bbfee
18 changed files with 1136 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
package com.backend.unifier.title.service;
import org.eclipse.microprofile.rest.client.inject.RestClient;
import org.jboss.logging.Logger;
import com.backend.unifier.title.service.api.KodikSearchService;
import com.backend.unifier.title.service.api.ShikimoriSearchService;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;
@Path("/hello")
public class GreetingResource {
Logger logger = Logger.getLogger(GreetingResource.class);
private final KodikSearchService kodikSearchService;
private final ShikimoriSearchService shikimoriSearchService;
public GreetingResource(@RestClient KodikSearchService kodikSearchService,
@RestClient ShikimoriSearchService shikimoriSearchService) {
this.kodikSearchService = kodikSearchService;
this.shikimoriSearchService = shikimoriSearchService;
}
@GET
@Produces(MediaType.TEXT_PLAIN)
public void hello() {
logger.info(kodikSearchService.search("Стальной алхимик"));
logger.info(shikimoriSearchService.findById("3701"));
}
}

View File

@@ -0,0 +1,17 @@
package com.backend.unifier.title.service.api;
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;
import com.backend.search.kodik.service.api.model.KodikResponse;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.QueryParam;
@Path("/kodik")
@RegisterRestClient(baseUri = "stork://kodik-metadata-service")
public interface KodikSearchService {
@GET
@Path("/search")
KodikResponse search(@QueryParam("title") String title);
}

View File

@@ -0,0 +1,17 @@
package com.backend.unifier.title.service.api;
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;
import com.backend.metadata.shikimori.api.model.Anime;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.QueryParam;
@Path("/shikimori")
@RegisterRestClient(baseUri = "stork://shikimori-metadata-service")
public interface ShikimoriSearchService {
@GET
@Path("/search")
Anime findById(@QueryParam("id") String id);
}