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:
@@ -4,9 +4,9 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>fr.codeanddata.semrack</groupId>
|
||||
<artifactId>semrack-parent</artifactId>
|
||||
<artifactId>semrack-bom</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
<relativePath>../../bom/pom.xml</relativePath>
|
||||
</parent>
|
||||
<artifactId>semrack-api-rest-parent</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
package fr.codeanddata.semrack.api.rest;
|
||||
|
||||
import fr.codeanddata.semrack.core.models.*;
|
||||
import fr.codeanddata.semrack.core.repositories.DocumentRepository;
|
||||
import fr.codeanddata.semrack.models.*;
|
||||
import io.smallrye.mutiny.Uni;
|
||||
import jakarta.inject.Inject;
|
||||
import jakarta.ws.rs.GET;
|
||||
import jakarta.ws.rs.POST;
|
||||
import jakarta.ws.rs.PUT;
|
||||
import jakarta.ws.rs.Path;
|
||||
import jakarta.ws.rs.Produces;
|
||||
import jakarta.ws.rs.core.MediaType;
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>fr.codeanddata.semrack</groupId>
|
||||
<artifactId>semrack-parent</artifactId>
|
||||
<artifactId>semrack-bom</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
<relativePath>../../bom/pom.xml</relativePath>
|
||||
</parent>
|
||||
<artifactId>semrack-core-parent</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
@@ -12,6 +12,10 @@
|
||||
<name>Semrack Core - Runtime</name>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fr.codeanddata.semrack</groupId>
|
||||
<artifactId>semrack</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-arc</artifactId>
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
package fr.codeanddata.semrack.core;
|
||||
|
||||
import fr.codeanddata.semrack.core.models.IndexSearchResult;
|
||||
import fr.codeanddata.semrack.core.models.Search;
|
||||
import io.smallrye.mutiny.Uni;
|
||||
|
||||
public interface Index {
|
||||
Uni<Long> count(Search request);
|
||||
Uni<Boolean> exist(Search query);
|
||||
Uni<Void> index(String documentId);
|
||||
Uni<IndexSearchResult> search(Search search);
|
||||
Uni<Void> clear(String documentId);
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package fr.codeanddata.semrack.core;
|
||||
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import jakarta.enterprise.inject.spi.CDI;
|
||||
|
||||
public interface LookupExpression<T> {
|
||||
String apply(Object params);
|
||||
|
||||
default T convert(Object params) {
|
||||
return CDI.current().select(ObjectMapper.class).get().convertValue(params, new TypeReference<T>() {});
|
||||
}
|
||||
|
||||
default T convert(Object params, Class<T> clazz) {
|
||||
return CDI.current().select(ObjectMapper.class).get().convertValue(params, clazz);
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package fr.codeanddata.semrack.core;
|
||||
|
||||
import fr.codeanddata.semrack.core.models.ReadContext;
|
||||
import io.smallrye.mutiny.Uni;
|
||||
|
||||
public interface ReadInterceptor {
|
||||
Uni<Void> interceptSemdocRead(ReadContext context);
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package fr.codeanddata.semrack.core;
|
||||
|
||||
import fr.codeanddata.semrack.core.models.SearchContext;
|
||||
import io.smallrye.mutiny.Uni;
|
||||
|
||||
public interface SearchInterceptor {
|
||||
Uni<Void> interceptSemdocSearch(SearchContext context);
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package fr.codeanddata.semrack.core;
|
||||
|
||||
import fr.codeanddata.semrack.core.models.Document;
|
||||
import fr.codeanddata.semrack.core.models.StorageGet;
|
||||
import io.smallrye.mutiny.Uni;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface Storage {
|
||||
Uni<Document> get(String uid, StorageGet request);
|
||||
Uni<List<Document>> get(List<String> uids, StorageGet request);
|
||||
Uni<Document> storeDocument(Document document);
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package fr.codeanddata.semrack.core;
|
||||
|
||||
import fr.codeanddata.semrack.core.models.WriteContext;
|
||||
import io.smallrye.mutiny.Uni;
|
||||
|
||||
public interface WriteInterceptor {
|
||||
Uni<Void> interceptSemdocWrite(WriteContext context);
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
package fr.codeanddata.semrack.core.enums;
|
||||
|
||||
public enum SortDirection {
|
||||
asc, desc
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package fr.codeanddata.semrack.core.exceptions;
|
||||
|
||||
public class SemrackException extends Exception {
|
||||
public SemrackException() {
|
||||
}
|
||||
|
||||
public SemrackException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public SemrackException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
public SemrackException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package fr.codeanddata.semrack.core.exceptions;
|
||||
|
||||
public class SemrackRuntimeException extends RuntimeException {
|
||||
public SemrackRuntimeException() {
|
||||
}
|
||||
|
||||
public SemrackRuntimeException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public SemrackRuntimeException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
public SemrackRuntimeException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,8 @@ package fr.codeanddata.semrack.core.interceptors;
|
||||
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import fr.codeanddata.semrack.core.WriteInterceptor;
|
||||
import fr.codeanddata.semrack.core.models.WriteContext;
|
||||
import fr.codeanddata.semrack.WriteInterceptor;
|
||||
import fr.codeanddata.semrack.models.WriteContext;
|
||||
import io.smallrye.mutiny.Uni;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
import jakarta.inject.Inject;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package fr.codeanddata.semrack.core.interceptors;
|
||||
|
||||
import fr.codeanddata.semrack.core.WriteInterceptor;
|
||||
import fr.codeanddata.semrack.core.models.WriteContext;
|
||||
import fr.codeanddata.semrack.core.models.Document;
|
||||
import fr.codeanddata.semrack.WriteInterceptor;
|
||||
import fr.codeanddata.semrack.models.WriteContext;
|
||||
import fr.codeanddata.semrack.models.Document;
|
||||
import fr.codeanddata.semrack.core.utils.UIDGenerator;
|
||||
import io.smallrye.mutiny.Uni;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package fr.codeanddata.semrack.core.mappers;
|
||||
|
||||
import fr.codeanddata.semrack.core.models.Document;
|
||||
import fr.codeanddata.semrack.core.models.PushDocument;
|
||||
import fr.codeanddata.semrack.models.Document;
|
||||
import fr.codeanddata.semrack.models.PushDocument;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
import org.mapstruct.MappingConstants;
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
package fr.codeanddata.semrack.core.models;
|
||||
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@RegisterForReflection(serialization = true)
|
||||
public class Document {
|
||||
|
||||
/**
|
||||
* L'identifiant unique du document.
|
||||
*/
|
||||
String uid;
|
||||
|
||||
/**
|
||||
* Les annotations sont créées par le système, au travers des extensions. Elles sont en lecture seule.
|
||||
* Elles ont pour vocation d'aider au classement et à la recherche du document (tags, catégories, date de création, etc.).
|
||||
*/
|
||||
Map<String, Object> annotations;
|
||||
|
||||
/**
|
||||
* Le contenu du document.
|
||||
*/
|
||||
Map<String, Object> metadata;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
Map<String, Object> fields;
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package fr.codeanddata.semrack.core.models;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class IndexSearchResult {
|
||||
List<String> uids;
|
||||
PaginationInfo pagination;
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package fr.codeanddata.semrack.core.models;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class Pagination {
|
||||
Integer page;
|
||||
Integer size;
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package fr.codeanddata.semrack.core.models;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PaginationInfo {
|
||||
long page;
|
||||
long size;
|
||||
long total;
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package fr.codeanddata.semrack.core.models;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class PushDocument {
|
||||
/**
|
||||
* L'identifiant unique du document.
|
||||
*/
|
||||
String uid;
|
||||
|
||||
/**
|
||||
* Les directives sont les paramètres d'extensions.
|
||||
* Elles ont pour vocation de générer des actions sur les documents, comme le publish, etc...
|
||||
*/
|
||||
Map<String, Object> directives;
|
||||
|
||||
/**
|
||||
* Le contenu du document.
|
||||
*/
|
||||
Map<String, Object> metadata;
|
||||
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
package fr.codeanddata.semrack.core.models;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ReadContext {
|
||||
Document currentDocument;
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package fr.codeanddata.semrack.core.models;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class Search {
|
||||
Map<String, Object> filter;
|
||||
List<Sort> sort;
|
||||
Pagination paginate;
|
||||
Boolean annotations;
|
||||
Boolean metadata;
|
||||
Map<String, String> fields;
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package fr.codeanddata.semrack.core.models;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SearchContext {
|
||||
|
||||
Map<String, Object> search;
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package fr.codeanddata.semrack.core.models;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class SearchResult {
|
||||
List<Document> documents;
|
||||
PaginationInfo pagination;
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package fr.codeanddata.semrack.core.models;
|
||||
|
||||
import fr.codeanddata.semrack.core.enums.SortDirection;
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class Sort {
|
||||
String field;
|
||||
SortDirection direction;
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package fr.codeanddata.semrack.core.models;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class StorageGet {
|
||||
Boolean metadataSource;
|
||||
Boolean annotationsSource;
|
||||
Map<String, String> fields;
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package fr.codeanddata.semrack.core.models;
|
||||
|
||||
import fr.codeanddata.semrack.core.utils.Traverser;
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class TraverserPath {
|
||||
Traverser.PathTypes type;
|
||||
String fullPath;
|
||||
Object value;
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
package fr.codeanddata.semrack.core.models;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class WriteContext {
|
||||
|
||||
/**
|
||||
* Previous stored document
|
||||
*/
|
||||
Document currentDocument;
|
||||
|
||||
/**
|
||||
* Document to be store. It initialized with :
|
||||
* - the currentDocument uid if exists, or a new one
|
||||
* - the metadata to be persisted
|
||||
*/
|
||||
Document nextDocument;
|
||||
|
||||
/**
|
||||
* The directives to be applied
|
||||
*/
|
||||
Map<String, Object> directives;
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
package fr.codeanddata.semrack.core.repositories;
|
||||
|
||||
import fr.codeanddata.semrack.core.WriteInterceptor;
|
||||
import fr.codeanddata.semrack.core.exceptions.SemrackRuntimeException;
|
||||
import fr.codeanddata.semrack.core.models.*;
|
||||
import fr.codeanddata.semrack.WriteInterceptor;
|
||||
import fr.codeanddata.semrack.exceptions.SemrackRuntimeException;
|
||||
import fr.codeanddata.semrack.core.storages.StorageProxy;
|
||||
import fr.codeanddata.semrack.core.utils.UIDGenerator;
|
||||
import fr.codeanddata.semrack.models.*;
|
||||
import io.smallrye.mutiny.Uni;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
import jakarta.enterprise.inject.Any;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package fr.codeanddata.semrack.core.services;
|
||||
|
||||
import fr.codeanddata.semrack.core.Index;
|
||||
import fr.codeanddata.semrack.core.models.IndexSearchResult;
|
||||
import fr.codeanddata.semrack.core.models.Search;
|
||||
import fr.codeanddata.semrack.Index;
|
||||
import fr.codeanddata.semrack.models.IndexSearchResult;
|
||||
import fr.codeanddata.semrack.models.Search;
|
||||
import io.smallrye.mutiny.Uni;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
import jakarta.inject.Inject;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package fr.codeanddata.semrack.core.services;
|
||||
|
||||
import fr.codeanddata.semrack.core.LookupExpression;
|
||||
import fr.codeanddata.semrack.LookupExpression;
|
||||
import io.quarkus.runtime.StartupEvent;
|
||||
import io.smallrye.common.annotation.Identifier;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package fr.codeanddata.semrack.core.storages;
|
||||
|
||||
import fr.codeanddata.semrack.core.Index;
|
||||
import fr.codeanddata.semrack.core.Storage;
|
||||
import fr.codeanddata.semrack.core.models.Search;
|
||||
import fr.codeanddata.semrack.core.models.SearchResult;
|
||||
import fr.codeanddata.semrack.core.models.Document;
|
||||
import fr.codeanddata.semrack.core.models.StorageGet;
|
||||
import fr.codeanddata.semrack.Index;
|
||||
import fr.codeanddata.semrack.Storage;
|
||||
import fr.codeanddata.semrack.models.Search;
|
||||
import fr.codeanddata.semrack.models.SearchResult;
|
||||
import fr.codeanddata.semrack.models.Document;
|
||||
import fr.codeanddata.semrack.models.StorageGet;
|
||||
import io.smallrye.mutiny.Uni;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
import jakarta.inject.Inject;
|
||||
|
||||
@@ -2,8 +2,8 @@ package fr.codeanddata.semrack.core.utils;
|
||||
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import fr.codeanddata.semrack.core.models.TraverserPath;
|
||||
import io.vertx.core.json.Json;
|
||||
import fr.codeanddata.semrack.enums.PathTypes;
|
||||
import fr.codeanddata.semrack.models.TraverserPath;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
import jakarta.inject.Inject;
|
||||
|
||||
@@ -21,15 +21,6 @@ public class Traverser implements Function<Object, List<TraverserPath>> {
|
||||
return parse("", o);
|
||||
}
|
||||
|
||||
public enum PathTypes {
|
||||
UNKNOWN,
|
||||
STRING,
|
||||
NUMBER,
|
||||
BOOLEAN,
|
||||
LIST,
|
||||
OBJECT
|
||||
}
|
||||
|
||||
List<TraverserPath> parse(String basePath, Object data) {
|
||||
final List<TraverserPath> paths = new ArrayList<>();
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package fr.codeanddata.semrack.core.utils;
|
||||
|
||||
import fr.codeanddata.semrack.core.models.Document;
|
||||
import fr.codeanddata.semrack.models.Document;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
import org.apache.commons.codec.digest.DigestUtils;
|
||||
|
||||
|
||||
@@ -16,6 +16,10 @@
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-arc</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.codeanddata.semrack</groupId>
|
||||
<artifactId>semrack</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.codeanddata.semrack</groupId>
|
||||
<artifactId>semrack-core</artifactId>
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package fr.codeanddata.semrack.core;
|
||||
|
||||
import fr.codeanddata.semrack.core.models.IndexSearchResult;
|
||||
import fr.codeanddata.semrack.core.models.Search;
|
||||
import fr.codeanddata.semrack.core.models.Document;
|
||||
import fr.codeanddata.semrack.core.models.StorageGet;
|
||||
import fr.codeanddata.semrack.Index;
|
||||
import fr.codeanddata.semrack.Storage;
|
||||
import fr.codeanddata.semrack.models.IndexSearchResult;
|
||||
import fr.codeanddata.semrack.models.Search;
|
||||
import fr.codeanddata.semrack.models.Document;
|
||||
import fr.codeanddata.semrack.models.StorageGet;
|
||||
import io.quarkus.arc.DefaultBean;
|
||||
import io.smallrye.mutiny.Uni;
|
||||
import jakarta.annotation.Priority;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package fr.codeanddata.semrack.core.utils;
|
||||
|
||||
import fr.codeanddata.semrack.core.models.TraverserPath;
|
||||
import fr.codeanddata.semrack.enums.PathTypes;
|
||||
import fr.codeanddata.semrack.models.TraverserPath;
|
||||
import io.quarkus.test.junit.QuarkusTest;
|
||||
import jakarta.inject.Inject;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
@@ -33,16 +34,16 @@ public class TraverserTest {
|
||||
Assertions.assertEquals(14, paths.size());
|
||||
|
||||
List<List<?>> expectations = List.of(
|
||||
Arrays.asList(".user", null, Traverser.PathTypes.OBJECT),
|
||||
Arrays.asList(".user.age", 14, Traverser.PathTypes.NUMBER),
|
||||
Arrays.asList(".user.family[0].age", 38, Traverser.PathTypes.NUMBER),
|
||||
Arrays.asList(".user.family[0].isAdult", true, Traverser.PathTypes.BOOLEAN),
|
||||
Arrays.asList(".user.family[0].name", "mom", Traverser.PathTypes.STRING),
|
||||
Arrays.asList(".user.family[1].age", 6, Traverser.PathTypes.NUMBER),
|
||||
Arrays.asList(".user.family[1].isAdult", false, Traverser.PathTypes.BOOLEAN),
|
||||
Arrays.asList(".user.family[1].name", "bro", Traverser.PathTypes.STRING),
|
||||
Arrays.asList(".user.isAdult", false, Traverser.PathTypes.BOOLEAN),
|
||||
Arrays.asList(".user.name", "bob", Traverser.PathTypes.STRING)
|
||||
Arrays.asList(".user", null, PathTypes.OBJECT),
|
||||
Arrays.asList(".user.age", 14, PathTypes.NUMBER),
|
||||
Arrays.asList(".user.family[0].age", 38, PathTypes.NUMBER),
|
||||
Arrays.asList(".user.family[0].isAdult", true, PathTypes.BOOLEAN),
|
||||
Arrays.asList(".user.family[0].name", "mom", PathTypes.STRING),
|
||||
Arrays.asList(".user.family[1].age", 6, PathTypes.NUMBER),
|
||||
Arrays.asList(".user.family[1].isAdult", false, PathTypes.BOOLEAN),
|
||||
Arrays.asList(".user.family[1].name", "bro", PathTypes.STRING),
|
||||
Arrays.asList(".user.isAdult", false, PathTypes.BOOLEAN),
|
||||
Arrays.asList(".user.name", "bob", PathTypes.STRING)
|
||||
);
|
||||
|
||||
for (List<?> expectation : expectations) {
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
<dependency>
|
||||
<groupId>fr.codeanddata.semrack</groupId>
|
||||
<artifactId>semrack-core-testing</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>fr.codeanddata.semrack</groupId>
|
||||
<artifactId>semrack-parent</artifactId>
|
||||
<artifactId>semrack-bom</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
<relativePath>../../bom/pom.xml</relativePath>
|
||||
</parent>
|
||||
<artifactId>semrack-index-postgres-parent</artifactId>
|
||||
<name>Semrack Index Postgres - Parent</name>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package fr.codeanddata.semrack.index.postgres;
|
||||
|
||||
import fr.codeanddata.semrack.core.Index;
|
||||
import fr.codeanddata.semrack.core.Storage;
|
||||
import fr.codeanddata.semrack.core.models.*;
|
||||
import fr.codeanddata.semrack.Index;
|
||||
import fr.codeanddata.semrack.Storage;
|
||||
import fr.codeanddata.semrack.core.services.LookupService;
|
||||
import fr.codeanddata.semrack.core.utils.Traverser;
|
||||
import fr.codeanddata.semrack.index.postgres.dtos.IndexEntry;
|
||||
import fr.codeanddata.semrack.index.postgres.entities.SemrackIndexEntity;
|
||||
import fr.codeanddata.semrack.index.postgres.repositories.SemrackIndexRepository;
|
||||
import fr.codeanddata.semrack.models.*;
|
||||
import io.quarkus.hibernate.reactive.panache.PanacheRepository;
|
||||
import io.quarkus.hibernate.reactive.panache.common.WithSession;
|
||||
import io.quarkus.hibernate.reactive.panache.common.WithTransaction;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package fr.codeanddata.semrack.index.postgres.dtos;
|
||||
|
||||
import fr.codeanddata.semrack.core.utils.Traverser;
|
||||
import fr.codeanddata.semrack.enums.PathTypes;
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@@ -9,6 +9,6 @@ import lombok.*;
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class IndexEntry {
|
||||
Traverser.PathTypes type;
|
||||
PathTypes type;
|
||||
Object value;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ package fr.codeanddata.semrack.index.postgres.operators;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import fr.codeanddata.semrack.core.exceptions.SemrackRuntimeException;
|
||||
import fr.codeanddata.semrack.exceptions.SemrackRuntimeException;
|
||||
import fr.codeanddata.semrack.index.postgres.EqualLookupParams;
|
||||
import io.smallrye.common.annotation.Identifier;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
|
||||
@@ -2,7 +2,7 @@ package fr.codeanddata.semrack.index.postgres.operators;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import fr.codeanddata.semrack.core.exceptions.SemrackRuntimeException;
|
||||
import fr.codeanddata.semrack.exceptions.SemrackRuntimeException;
|
||||
import fr.codeanddata.semrack.index.postgres.InLookupParams;
|
||||
import io.smallrye.common.annotation.Identifier;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package fr.codeanddata.semrack.index.postgres.operators;
|
||||
|
||||
import fr.codeanddata.semrack.core.LookupExpression;
|
||||
import fr.codeanddata.semrack.LookupExpression;
|
||||
|
||||
public interface JpaLookupExpression<T> extends LookupExpression<T> {
|
||||
}
|
||||
|
||||
72
modules/semrack-rest-client/deployment/pom.xml
Normal file
72
modules/semrack-rest-client/deployment/pom.xml
Normal file
@@ -0,0 +1,72 @@
|
||||
<?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-deployment</artifactId>
|
||||
<name>Semrack Rest Client - Deployment</name>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-arc-deployment</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-rest-client-deployment</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-rest-client-jackson-deployment</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>fr.codeanddata.semrack</groupId>
|
||||
<artifactId>semrack-rest-client</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-junit-internal</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-junit-mockito</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.codeanddata.semrack</groupId>
|
||||
<artifactId>semrack-core-testing</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>default-compile</id>
|
||||
<configuration>
|
||||
<annotationProcessorPaths>
|
||||
<path>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-extension-processor</artifactId>
|
||||
<version>${quarkus.version}</version>
|
||||
</path>
|
||||
</annotationProcessorPaths>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -0,0 +1,14 @@
|
||||
package fr.codeanddata.semrack.rest.client.deployment;
|
||||
|
||||
import io.quarkus.deployment.annotations.BuildStep;
|
||||
import io.quarkus.deployment.builditem.FeatureBuildItem;
|
||||
|
||||
class SemrackRestClientProcessor {
|
||||
|
||||
private static final String FEATURE = "semrack-rest-client";
|
||||
|
||||
@BuildStep
|
||||
FeatureBuildItem feature() {
|
||||
return new FeatureBuildItem(FEATURE);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package fr.codeanddata.semrack.rest.client.test;
|
||||
|
||||
import org.jboss.shrinkwrap.api.ShrinkWrap;
|
||||
import org.jboss.shrinkwrap.api.spec.JavaArchive;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||
|
||||
import io.quarkus.test.QuarkusDevModeTest;
|
||||
|
||||
public class SemrackRestClientDevModeTest {
|
||||
|
||||
// Start hot reload (DevMode) test with your extension loaded
|
||||
@RegisterExtension
|
||||
static final QuarkusDevModeTest devModeTest = new QuarkusDevModeTest()
|
||||
.setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class));
|
||||
|
||||
@Test
|
||||
public void writeYourOwnDevModeTest() {
|
||||
// Write your dev mode tests here - see the testing extension guide https://quarkus.io/guides/writing-extensions#testing-hot-reload for more information
|
||||
Assertions.assertTrue(true, "Add dev mode assertions to " + getClass().getName());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package fr.codeanddata.semrack.rest.client.test;
|
||||
|
||||
import fr.codeanddata.semrack.rest.client.runtime.SemrackRestClient;
|
||||
import io.quarkus.test.QuarkusUnitTest;
|
||||
import org.eclipse.microprofile.rest.client.inject.RestClient;
|
||||
import org.jboss.shrinkwrap.api.ShrinkWrap;
|
||||
import org.jboss.shrinkwrap.api.spec.JavaArchive;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||
|
||||
public class SemrackRestClientTest {
|
||||
|
||||
@RestClient
|
||||
SemrackRestClient restClient;
|
||||
|
||||
// Start unit test with your extension loaded
|
||||
@RegisterExtension
|
||||
static final QuarkusUnitTest unitTest = new QuarkusUnitTest()
|
||||
.setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class));
|
||||
|
||||
@Test
|
||||
public void writeYourOwnUnitTest() {
|
||||
// Write your unit tests here - see the testing extension guide https://quarkus.io/guides/writing-extensions#testing-extensions for more information
|
||||
Assertions.assertTrue(true, "Add some assertions to " + getClass().getName());
|
||||
Assertions.assertNotNull(restClient);
|
||||
}
|
||||
}
|
||||
98
modules/semrack-rest-client/integration-tests/pom.xml
Normal file
98
modules/semrack-rest-client/integration-tests/pom.xml
Normal file
@@ -0,0 +1,98 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>semrack-rest-client-integration-tests</artifactId>
|
||||
<name>Semrack Rest Client - Integration Tests</name>
|
||||
|
||||
<properties>
|
||||
<skipITs>true</skipITs>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-rest</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>fr.codeanddata.semrack</groupId>
|
||||
<artifactId>semrack-rest-client</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-junit</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.rest-assured</groupId>
|
||||
<artifactId>rest-assured</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>build</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-failsafe-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>integration-test</goal>
|
||||
<goal>verify</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<systemPropertyVariables>
|
||||
<native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
|
||||
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
|
||||
<maven.home>${maven.home}</maven.home>
|
||||
</systemPropertyVariables>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>native-image</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>native</name>
|
||||
</property>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<skipTests>${native.surefire.skip}</skipTests>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<properties>
|
||||
<quarkus.package.jar.enabled>false</quarkus.package.jar.enabled>
|
||||
<skipITs>false</skipITs>
|
||||
<quarkus.native.enabled>true</quarkus.native.enabled>
|
||||
</properties>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package fr.codeanddata.semrack.rest.client.it;
|
||||
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
import jakarta.ws.rs.GET;
|
||||
import jakarta.ws.rs.Path;
|
||||
|
||||
@Path("/semrack-rest-client")
|
||||
@ApplicationScoped
|
||||
public class SemrackRestClientResource {
|
||||
// add some rest methods here
|
||||
|
||||
@GET
|
||||
public String hello() {
|
||||
return "Hello semrack-rest-client";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package fr.codeanddata.semrack.rest.client.it;
|
||||
|
||||
import io.quarkus.test.junit.QuarkusIntegrationTest;
|
||||
|
||||
@QuarkusIntegrationTest
|
||||
public class SemrackRestClientResourceIT extends SemrackRestClientResourceTest {
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package fr.codeanddata.semrack.rest.client.it;
|
||||
|
||||
import static io.restassured.RestAssured.given;
|
||||
import static org.hamcrest.Matchers.is;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import io.quarkus.test.junit.QuarkusTest;
|
||||
|
||||
@QuarkusTest
|
||||
public class SemrackRestClientResourceTest {
|
||||
|
||||
@Test
|
||||
public void testHelloEndpoint() {
|
||||
given()
|
||||
.when().get("/semrack-rest-client")
|
||||
.then()
|
||||
.statusCode(200)
|
||||
.body(is("Hello semrack-rest-client"));
|
||||
}
|
||||
}
|
||||
21
modules/semrack-rest-client/pom.xml
Normal file
21
modules/semrack-rest-client/pom.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?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-bom</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<relativePath>../../bom/pom.xml</relativePath>
|
||||
</parent>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<artifactId>semrack-rest-client-parent</artifactId>
|
||||
<name>Semrack Rest Client - Parent</name>
|
||||
|
||||
<modules>
|
||||
<module>deployment</module>
|
||||
<module>runtime</module>
|
||||
</modules>
|
||||
|
||||
</project>
|
||||
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
|
||||
@@ -1,6 +1,6 @@
|
||||
package fr.codeanddata.semrack.storage.postgres.storage;
|
||||
|
||||
import fr.codeanddata.semrack.core.models.StorageGet;
|
||||
import fr.codeanddata.semrack.models.StorageGet;
|
||||
import io.quarkus.hibernate.reactive.panache.Panache;
|
||||
import io.quarkus.test.junit.QuarkusTest;
|
||||
import io.quarkus.test.vertx.RunOnVertxContext;
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>fr.codeanddata.semrack</groupId>
|
||||
<artifactId>semrack-parent</artifactId>
|
||||
<artifactId>semrack-bom</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
<relativePath>../../bom/pom.xml</relativePath>
|
||||
</parent>
|
||||
<artifactId>semrack-storage-postgres-parent</artifactId>
|
||||
<name>Semrack Storage Postgres - Parent</name>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package fr.codeanddata.semrack.storage.postgres.entities;
|
||||
|
||||
import fr.codeanddata.semrack.core.models.Document;
|
||||
import fr.codeanddata.semrack.models.Document;
|
||||
import io.quarkus.hibernate.reactive.panache.PanacheEntity;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
|
||||
@@ -2,9 +2,9 @@ package fr.codeanddata.semrack.storage.postgres.storage;
|
||||
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import fr.codeanddata.semrack.core.Storage;
|
||||
import fr.codeanddata.semrack.core.models.Document;
|
||||
import fr.codeanddata.semrack.core.models.StorageGet;
|
||||
import fr.codeanddata.semrack.Storage;
|
||||
import fr.codeanddata.semrack.models.Document;
|
||||
import fr.codeanddata.semrack.models.StorageGet;
|
||||
import fr.codeanddata.semrack.core.utils.UIDGenerator;
|
||||
import fr.codeanddata.semrack.storage.postgres.entities.SemrackDocumentEntity;
|
||||
import io.quarkus.hibernate.reactive.panache.PanacheRepository;
|
||||
|
||||
Reference in New Issue
Block a user