diff --git a/account-service/src/main/java/com/drinkool/services/CustomerService.java b/account-service/src/main/java/com/drinkool/services/CustomerService.java index c8bba92..c67fc91 100644 --- a/account-service/src/main/java/com/drinkool/services/CustomerService.java +++ b/account-service/src/main/java/com/drinkool/services/CustomerService.java @@ -1,12 +1,13 @@ package com.drinkool.services; import com.drinkool.*; -import com.drinkool.entities.CustomerEntity; import com.drinkool.dtos.*; +import com.drinkool.entities.CustomerEntity; import jakarta.inject.Inject; import jakarta.transaction.Transactional; import jakarta.ws.rs.*; import jakarta.ws.rs.core.*; +import java.util.UUID; @Path(Role.Customer) public class CustomerService extends BaseService { @@ -88,4 +89,10 @@ public class CustomerService extends BaseService { .entity(customer) .build(); } + + @GET + @Path("/{id}") + public Response findStaff(@PathParam("id") UUID staffId) { + return Response.ok(CustomerEntity.findById(staffId)).build(); + } } diff --git a/eatery-service/src/main/java/com/drinkool/services/ReviewService.java b/eatery-service/src/main/java/com/drinkool/services/ReviewService.java index c09a7bd..ed297fd 100644 --- a/eatery-service/src/main/java/com/drinkool/services/ReviewService.java +++ b/eatery-service/src/main/java/com/drinkool/services/ReviewService.java @@ -4,9 +4,9 @@ import com.drinkool.InternalValue; import com.drinkool.Role; import com.drinkool.Url; import com.drinkool.dtos.DtoMapper; +import com.drinkool.dtos.SendReview; import com.drinkool.entities.ReviewEntity; import com.drinkool.enums.SortBy; -import com.drinkool.dtos.SendReview; import io.quarkus.panache.common.Sort; import io.vertx.core.http.HttpServerRequest; import jakarta.annotation.security.RolesAllowed; @@ -45,7 +45,13 @@ public class ReviewService { }; return Response.ok() - .entity(ReviewEntity.find("eatery.id = ?1", sort, eateryId).list()) + .entity( + ReviewEntity.find( + "FROM ReviewEntity r LEFT JOIN FETCH r.eatery WHERE r.eatery.id = ?1", + sort, + eateryId + ).list() + ) .build(); } diff --git a/gateway-service/src/main/java/com/drinkool/controller/CustomerController.java b/gateway-service/src/main/java/com/drinkool/controller/CustomerController.java index 36efce8..f5993e8 100644 --- a/gateway-service/src/main/java/com/drinkool/controller/CustomerController.java +++ b/gateway-service/src/main/java/com/drinkool/controller/CustomerController.java @@ -39,4 +39,10 @@ public class CustomerController { public Uni me(@HeaderParam(InternalValue.userId) UUID id) { return accountService.me(id); } + + @GET + @Path("/{id}") + public Uni findCustomer(@PathParam("id") UUID id) { + return accountService.findCustomer(id); + } } diff --git a/gateway-service/src/main/java/com/drinkool/services/CustomerService.java b/gateway-service/src/main/java/com/drinkool/services/CustomerService.java index 5660e19..1a27658 100644 --- a/gateway-service/src/main/java/com/drinkool/services/CustomerService.java +++ b/gateway-service/src/main/java/com/drinkool/services/CustomerService.java @@ -32,4 +32,8 @@ public interface CustomerService { @GET @Path(Url.Me) Uni me(@HeaderParam(InternalValue.userId) UUID id); + + @GET + @Path("/{id}") + public Uni findCustomer(@PathParam("id") UUID id); }