From 6ae7ad30afbd0502805a0ee2079b41b69a696ef3 Mon Sep 17 00:00:00 2001 From: nowgnas Date: Thu, 28 Dec 2023 11:37:50 +0900 Subject: [PATCH] =?UTF-8?q?:sparkles:=20LF1-859=20=EC=A3=BC=EB=AC=B8=20?= =?UTF-8?q?=EA=B2=B0=EC=A0=9C=20=EC=9A=94=EC=B2=AD=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 ++- .../application/handler/ProductQueryHandler.java | 10 +++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index c7ceab2f..90c0b949 100644 --- a/.gitignore +++ b/.gitignore @@ -37,4 +37,5 @@ out/ .vscode/ docker.sh *.DS_Store -data.sql \ No newline at end of file +data.sql +ProductKafkaTest.java \ No newline at end of file diff --git a/src/main/java/kr/bb/product/domain/product/application/handler/ProductQueryHandler.java b/src/main/java/kr/bb/product/domain/product/application/handler/ProductQueryHandler.java index 9e39a292..293a86f5 100644 --- a/src/main/java/kr/bb/product/domain/product/application/handler/ProductQueryHandler.java +++ b/src/main/java/kr/bb/product/domain/product/application/handler/ProductQueryHandler.java @@ -12,17 +12,21 @@ @RequiredArgsConstructor public class ProductQueryHandler { private static final String STORE_AVERAGE_RATING_UPDATE_TOPIC = "store-average-rating-update"; + private static final String ORDER_CREATE = "order-create"; private final ProductQueryUseCase productQueryUseCase; private final StoreServiceClient storeServiceClient; - private final ProductKafkaProcessor> productKafkaProcessor; + private final ProductKafkaProcessor> mapProductKafkaProcessor; + private final ProductKafkaProcessor processOrderDtoProductKafkaProcessor; public void getStoreAverageRating() { - Map storeAverageRating = productQueryUseCase.getStoreAverageRating(); - productKafkaProcessor.send(STORE_AVERAGE_RATING_UPDATE_TOPIC, storeAverageRating); + mapProductKafkaProcessor.send( + STORE_AVERAGE_RATING_UPDATE_TOPIC, productQueryUseCase.getStoreAverageRating()); } public void getFlowerAmountForOrder(ProcessOrderDto processOrderDto) { storeServiceClient.flowerStockDecreaseRequest( productQueryUseCase.getFlowerAmountGroupByStoreId(processOrderDto)); + // order create request kafka + processOrderDtoProductKafkaProcessor.send(ORDER_CREATE, processOrderDto); } }