Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ LF1-859 주문 결제 요청 추가 #57

Merged
merged 1 commit into from
Dec 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
}
}
Loading