Skip to content

Commit

Permalink
feat: cart 조회 시 menuId, menuImg 반환 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
LEEJaeHyeok97 committed Dec 6, 2024
1 parent bdcc220 commit 7a99c33
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,12 @@ public CartResponse getCartItems(String userProviderId) {

List<GetCartItemsResponse> 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();

Expand Down
Original file line number Diff line number Diff line change
@@ -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);
}
}

0 comments on commit 7a99c33

Please sign in to comment.