From eb1682e76c3135c6bb88cd2fc1def8703a8d3643 Mon Sep 17 00:00:00 2001 From: sujith-mn Date: Fri, 17 Sep 2021 16:02:29 +0530 Subject: [PATCH 1/4] rest layer fix --- .../service/v1/ProductRestService.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/devonfw/quarkus/productmanagement/service/v1/ProductRestService.java b/src/main/java/com/devonfw/quarkus/productmanagement/service/v1/ProductRestService.java index b886fcea..03f7f794 100644 --- a/src/main/java/com/devonfw/quarkus/productmanagement/service/v1/ProductRestService.java +++ b/src/main/java/com/devonfw/quarkus/productmanagement/service/v1/ProductRestService.java @@ -61,35 +61,35 @@ public PageImpl getAll(@BeanParam ProductSearchCriteriaDto dto) { } @GET - @Path("criteriaApi") - public PageImpl getAllCriteriaApi(@BeanParam ProductSearchCriteriaDto dto) { + @Path("search") + public PageImpl getProductsByCriteriaApi(@BeanParam ProductSearchCriteriaDto dto) { return (PageImpl) this.ucFindProduct.findProductsByCriteriaApi(dto); } - @GET - @Path("queryDsl") - public PageImpl getAllQueryDsl(@BeanParam ProductSearchCriteriaDto dto) { + @POST + @Path("search") + public PageImpl getProductsByQueryDsl(@BeanParam ProductSearchCriteriaDto dto) { return (PageImpl) this.ucFindProduct.findProductsByQueryDsl(dto); } @GET - @Path("query") - public PageImpl getAllQuery(@BeanParam ProductSearchCriteriaDto dto) { + @Path("sarchbytitle") + public PageImpl getProductsByTitleQuery(@BeanParam ProductSearchCriteriaDto dto) { return (PageImpl) this.ucFindProduct.findProductsByTitleQuery(dto); } - @GET - @Path("nativeQuery") + @POST + @Path("sarchbytitle") public PageImpl getAllNativeQuery(@BeanParam ProductSearchCriteriaDto dto) { return (PageImpl) this.ucFindProduct.findProductsByTitleNativeQuery(dto); } @GET - @Path("ordered") + @Path("searchall") public PageImpl getAllOrderedByTitle() { return (PageImpl) this.ucFindProduct.findProductsOrderedByTitle(); From 77030a63a5b7ca3848c2d70f6cfb23afc6a21b8b Mon Sep 17 00:00:00 2001 From: sujith-mn Date: Fri, 17 Sep 2021 16:09:21 +0530 Subject: [PATCH 2/4] rest service fix --- .../productmanagement/service/v1/ProductRestService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/devonfw/quarkus/productmanagement/service/v1/ProductRestService.java b/src/main/java/com/devonfw/quarkus/productmanagement/service/v1/ProductRestService.java index 03f7f794..f96b579e 100644 --- a/src/main/java/com/devonfw/quarkus/productmanagement/service/v1/ProductRestService.java +++ b/src/main/java/com/devonfw/quarkus/productmanagement/service/v1/ProductRestService.java @@ -30,7 +30,7 @@ //In Quarkus all JAX-RS resources are treated as CDI beans //default is Singleton scope -@Path("/products") +@Path("/product") // how we serialize response @Produces(MediaType.APPLICATION_JSON) // how we deserialize params From 87a1019a6904e0ea82409afbce35b916c285ad9e Mon Sep 17 00:00:00 2001 From: sujith-mn Date: Fri, 17 Sep 2021 19:56:31 +0530 Subject: [PATCH 3/4] fixed spelling mistake --- .../productmanagement/service/v1/ProductRestService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/devonfw/quarkus/productmanagement/service/v1/ProductRestService.java b/src/main/java/com/devonfw/quarkus/productmanagement/service/v1/ProductRestService.java index f96b579e..9569ba65 100644 --- a/src/main/java/com/devonfw/quarkus/productmanagement/service/v1/ProductRestService.java +++ b/src/main/java/com/devonfw/quarkus/productmanagement/service/v1/ProductRestService.java @@ -75,14 +75,14 @@ public PageImpl getProductsByQueryDsl(@BeanParam ProductSearchCriter } @GET - @Path("sarchbytitle") + @Path("searchbytitle") public PageImpl getProductsByTitleQuery(@BeanParam ProductSearchCriteriaDto dto) { return (PageImpl) this.ucFindProduct.findProductsByTitleQuery(dto); } @POST - @Path("sarchbytitle") + @Path("searchbytitle") public PageImpl getAllNativeQuery(@BeanParam ProductSearchCriteriaDto dto) { return (PageImpl) this.ucFindProduct.findProductsByTitleNativeQuery(dto); From bba55ebfecefcab35026ee7e5a5dba1d5982b93c Mon Sep 17 00:00:00 2001 From: sujith-mn Date: Fri, 17 Sep 2021 20:15:29 +0530 Subject: [PATCH 4/4] removed animal reference from URL. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 58329d37..76790de6 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ Our tests are now real integration tests with real postgres DB, and are stuitabl ## Access your REST endpoint -Go to http://localhost:8080/animals +Go to http://localhost:8080/ ## OpenAPI & Swagger UI