Skip to content

Commit 41019c8

Browse files
committed
7/31 사용자 관심 제품 제형 추가
1 parent f873fd2 commit 41019c8

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/main/java/com/BallaDream/BallaDream/dto/mypage/MyPageInterestedProductDto.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
public class MyPageInterestedProductDto {
1313
private Long productId;
1414
private String productName;
15+
private String formulation;
1516
private int price;
1617
private String salesLink;
1718
private String imageLink;

src/main/java/com/BallaDream/BallaDream/service/product/InterestedProductService.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ public void deleteInterestedProduct(Long productId, Long userId) {
7878
public MyPageInterestedProductResponseDto getUserInterestedProducts(int page, Long userId) {
7979
User user = userRepository.findById(userId).orElseThrow(
8080
() -> new UserException(INVALID_USER));
81-
PageRequest pageRequest = PageRequest.of(page, 9, Sort.by(Sort.Direction.DESC, "date"));
82-
Page<InterestedProduct> result = interestedProductRepository.findByUserId(userId, pageRequest);
81+
PageRequest pageRequest = PageRequest.of(page, 9, Sort.by(Sort.Direction.DESC, "date")); //최신순
82+
Page<InterestedProduct> result = interestedProductRepository.findByUserId(userId, pageRequest); //페이징
8383
List<InterestedProduct> content = result.getContent();
8484

8585
//사용자 관심 상품 & 성분 & 진단 종류를 가져오기
@@ -90,6 +90,7 @@ public MyPageInterestedProductResponseDto getUserInterestedProducts(int page, Lo
9090
.productName(product.getProductName())
9191
.price(product.getPrice())
9292
.productId(product.getId())
93+
.formulation(product.getFormulation())
9394
.element(product.getProductElements())
9495
.imageLink(product.getImageLink())
9596
.salesLink(product.getSalesLink())

0 commit comments

Comments
 (0)