From 7a99c3324f4c5d2362f4909cc95f344e8205d6f2 Mon Sep 17 00:00:00 2001 From: LEEJaeHyeok97 Date: Fri, 6 Dec 2024 22:28:59 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20cart=20=EC=A1=B0=ED=9A=8C=20=EC=8B=9C?= =?UTF-8?q?=20menuId,=20menuImg=20=EB=B0=98=ED=99=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/order/application/OrderService.java | 10 ++++++---- .../order/dto/response/GetCartItemsResponse.java | 6 ++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/jangburich/domain/order/application/OrderService.java b/src/main/java/com/jangburich/domain/order/application/OrderService.java index 1f29350..ee0f6ac 100644 --- a/src/main/java/com/jangburich/domain/order/application/OrderService.java +++ b/src/main/java/com/jangburich/domain/order/application/OrderService.java @@ -105,10 +105,12 @@ public CartResponse getCartItems(String userProviderId) { List cartItems = carts.stream() .map(cart -> GetCartItemsResponse.of( - cart.getMenu().getName(), - cart.getMenu().getDescription(), - cart.getQuantity(), - cart.getMenu().getPrice() + cart.getMenu().getId(), + cart.getMenu().getImageUrl(), + cart.getMenu().getName(), + cart.getMenu().getDescription(), + cart.getQuantity(), + cart.getMenu().getPrice() )) .toList(); diff --git a/src/main/java/com/jangburich/domain/order/dto/response/GetCartItemsResponse.java b/src/main/java/com/jangburich/domain/order/dto/response/GetCartItemsResponse.java index 1c0b120..74b0d07 100644 --- a/src/main/java/com/jangburich/domain/order/dto/response/GetCartItemsResponse.java +++ b/src/main/java/com/jangburich/domain/order/dto/response/GetCartItemsResponse.java @@ -1,13 +1,15 @@ package com.jangburich.domain.order.dto.response; public record GetCartItemsResponse( + Long menuId, + String menuImg, String menuName, String menuDescription, Integer quantity, Integer menuPrice ) { - public static GetCartItemsResponse of(String menuName, String menuDescription, Integer quantity, + public static GetCartItemsResponse of(Long menuId, String menuImg, String menuName, String menuDescription, Integer quantity, Integer menuPrice) { - return new GetCartItemsResponse(menuName, menuDescription, quantity, menuPrice); + return new GetCartItemsResponse(menuId, menuImg, menuName, menuDescription, quantity, menuPrice); } }