Skip to content

Commit

Permalink
Merge pull request #57 from nowgnas/LF1-859-order-payment-request
Browse files Browse the repository at this point in the history
✨ LF1-859 주문 결제 요청 추가
  • Loading branch information
JIUNG9 authored Dec 28, 2023
2 parents 72990ca + 6ae7ad3 commit b0fb358
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ out/
.vscode/
docker.sh
*.DS_Store
data.sql
data.sql
ProductKafkaTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<Map<Long, Double>> productKafkaProcessor;
private final ProductKafkaProcessor<Map<Long, Double>> mapProductKafkaProcessor;
private final ProductKafkaProcessor<ProcessOrderDto> processOrderDtoProductKafkaProcessor;

public void getStoreAverageRating() {
Map<Long, Double> 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);
}
}

0 comments on commit b0fb358

Please sign in to comment.