From ede47b5c35498d18da89c6fbe0767ab9b6f63185 Mon Sep 17 00:00:00 2001 From: moonwonki Date: Sat, 11 May 2024 19:38:41 +0900 Subject: [PATCH] =?UTF-8?q?:sparkles:=20feat:=20ReviewService=20=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=EB=84=A4=EC=9D=B4=EC=85=98=20=EC=A0=95?= =?UTF-8?q?=EB=B3=B4=20=EC=A3=BC=EB=8A=94=20=EB=A9=94=EC=86=8C=EB=93=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/example/WebOrder/service/ReviewService.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/com/example/WebOrder/service/ReviewService.java b/src/main/java/com/example/WebOrder/service/ReviewService.java index f36e83c2e5..f14bdc113d 100644 --- a/src/main/java/com/example/WebOrder/service/ReviewService.java +++ b/src/main/java/com/example/WebOrder/service/ReviewService.java @@ -13,6 +13,7 @@ import jakarta.servlet.http.Cookie; import jakarta.servlet.http.HttpServletRequest; import lombok.extern.slf4j.Slf4j; +import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; @@ -59,6 +60,10 @@ public List getReviewsOfItem(Long itemId, Pageable pageable){ return reviews.stream().map(ReviewDto::fromEntity).toList(); } + public Page getReviewPageOfItem(Long itemId, Pageable pageable){ + return reviewRepository.findByItemId(itemId, pageable); + } + // 주문할 때, 주문 내역에 해당하는 item id를 쿠키로 생성하는 코드. // 리뷰 서비스에 활용 됨.