Skip to content

Commit

Permalink
✨ feat: ReviewService 페이지네이션 정보 주는 메소드
Browse files Browse the repository at this point in the history
  • Loading branch information
moonwonki committed May 11, 2024
1 parent 49fa2fc commit ede47b5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/com/example/WebOrder/service/ReviewService.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -59,6 +60,10 @@ public List<ReviewDto> getReviewsOfItem(Long itemId, Pageable pageable){
return reviews.stream().map(ReviewDto::fromEntity).toList();
}

public Page<Review> getReviewPageOfItem(Long itemId, Pageable pageable){
return reviewRepository.findByItemId(itemId, pageable);
}


// 주문할 때, 주문 내역에 해당하는 item id를 쿠키로 생성하는 코드.
// 리뷰 서비스에 활용 됨.
Expand Down

0 comments on commit ede47b5

Please sign in to comment.