Add rest client + domain module
All checks were successful
Maven build / build (push) Successful in 4m18s
All checks were successful
Maven build / build (push) Successful in 4m18s
This commit is contained in:
70
modules/semrack-rest-client/runtime/pom.xml
Normal file
70
modules/semrack-rest-client/runtime/pom.xml
Normal file
@@ -0,0 +1,70 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>fr.codeanddata.semrack</groupId>
|
||||
<artifactId>semrack-rest-client-parent</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>semrack-rest-client</artifactId>
|
||||
<name>Semrack Rest Client - Runtime</name>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-arc</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-rest-client</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-rest-client-jackson</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.codeanddata.semrack</groupId>
|
||||
<artifactId>semrack</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-extension-maven-plugin</artifactId>
|
||||
<version>${quarkus.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>compile</phase>
|
||||
<goals>
|
||||
<goal>extension-descriptor</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<deployment>${project.groupId}:${project.artifactId}-deployment:${project.version}</deployment>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>default-compile</id>
|
||||
<configuration>
|
||||
<annotationProcessorPaths>
|
||||
<path>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-extension-processor</artifactId>
|
||||
</path>
|
||||
</annotationProcessorPaths>
|
||||
<annotationProcessorPathsUseDepMgmt>true</annotationProcessorPathsUseDepMgmt>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -0,0 +1,40 @@
|
||||
package fr.codeanddata.semrack.rest.client.runtime;
|
||||
|
||||
import fr.codeanddata.semrack.models.*;
|
||||
import io.smallrye.mutiny.Uni;
|
||||
import jakarta.ws.rs.*;
|
||||
import jakarta.ws.rs.core.MediaType;
|
||||
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;
|
||||
import org.jboss.resteasy.reactive.RestPath;
|
||||
|
||||
@Path("/documents")
|
||||
@RegisterRestClient(configKey="semrack-api")
|
||||
public interface SemrackRestClient {
|
||||
@POST
|
||||
@Consumes("application/json")
|
||||
@Produces("application/json")
|
||||
Uni<Document> pushDocument(PushDocument semrackDocument);
|
||||
|
||||
@POST
|
||||
@Path("/search")
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
Uni<SearchResult> searchDocument(Search query);
|
||||
|
||||
@GET
|
||||
@Path("{uid}")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
Uni<Document> getDocument(@RestPath String uid);
|
||||
|
||||
@POST
|
||||
@Path("{uid}")
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
Uni<Document> getDocument(@RestPath String uid, StorageGet request);
|
||||
|
||||
@POST
|
||||
@Path("{uid}/update")
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
Uni<Document> updateDocument(@RestPath String uid, PushDocument semrackDocument);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
name: Semrack Rest Client
|
||||
#description: Do something useful.
|
||||
metadata:
|
||||
# keywords:
|
||||
# - semrack-rest-client
|
||||
# guide: ... # To create and publish this guide, see https://github.com/quarkiverse/quarkiverse/wiki#documenting-your-extension
|
||||
# categories:
|
||||
# - "miscellaneous"
|
||||
# status: "preview"
|
||||
@@ -0,0 +1,2 @@
|
||||
semrack.rest.client.url=http://localhost:8080/semrack
|
||||
quarkus.rest-client.semrack-api.url=semrack.rest.client.url
|
||||
Reference in New Issue
Block a user