From 56e1d90ae5052ae377f4cae31df1715208357160 Mon Sep 17 00:00:00 2001 From: Nibras Ammar Date: Fri, 27 Dec 2024 16:15:54 +0100 Subject: [PATCH] Pricing api Fix after testing --- .../java/com/microservices/order_service/dto/CartItem.java | 4 +++- .../microservices/order_service/service/PricingService.java | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/order/src/main/java/com/microservices/order_service/dto/CartItem.java b/order/src/main/java/com/microservices/order_service/dto/CartItem.java index 725a7281..edab263f 100644 --- a/order/src/main/java/com/microservices/order_service/dto/CartItem.java +++ b/order/src/main/java/com/microservices/order_service/dto/CartItem.java @@ -7,6 +7,7 @@ import lombok.Setter; import java.util.List; +import java.util.UUID; @Getter @@ -14,5 +15,6 @@ @AllArgsConstructor @NoArgsConstructor public class CartItem { - private List items; + private UUID ProductId; + private int quantity; } diff --git a/order/src/main/java/com/microservices/order_service/service/PricingService.java b/order/src/main/java/com/microservices/order_service/service/PricingService.java index e010ec3b..8160ba23 100644 --- a/order/src/main/java/com/microservices/order_service/service/PricingService.java +++ b/order/src/main/java/com/microservices/order_service/service/PricingService.java @@ -17,14 +17,14 @@ public class PricingService { private WebClient webClient; public PricingService(WebClient.Builder webClientBuilder) { - this.webClient = webClientBuilder.baseUrl("http://localhost:8086/cart-total").build(); + this.webClient = webClientBuilder.baseUrl("http://localhost:8086/pricing/cart-total").build(); } public cartResponse checkPrice(List cartItems) { return webClient.post() - .uri("http://localhost:8086/cart-total") + .uri("http://localhost:8086/pricing/cart-total") .bodyValue(cartItems) .retrieve() .bodyToMono(new ParameterizedTypeReference() {})