From 2cbbc5ff78776ce21cc26f7755a4543d1bda37b8 Mon Sep 17 00:00:00 2001 From: ahyoon99 Date: Thu, 5 Sep 2024 22:49:50 +0900 Subject: [PATCH] =?UTF-8?q?addVisit=20=EC=88=98=EC=A0=95=ED=95=98=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 방문할 때 마다, lastVisitDate 수정해주기 Related to: #37 --- .../naverrestaurant/wishlist/service/WishListService.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/example/naverrestaurant/wishlist/service/WishListService.java b/src/main/java/com/example/naverrestaurant/wishlist/service/WishListService.java index 60c67a3..5cd2aa4 100644 --- a/src/main/java/com/example/naverrestaurant/wishlist/service/WishListService.java +++ b/src/main/java/com/example/naverrestaurant/wishlist/service/WishListService.java @@ -9,6 +9,7 @@ import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; +import java.time.LocalDateTime; import java.util.List; import java.util.Optional; import java.util.stream.Collectors; @@ -117,6 +118,7 @@ public void addVisit(int index, int starRating) { } restaurantEntity.setVisitCount(restaurantEntity.getVisitCount()+1); restaurantEntity.setStarRating(starRating); + restaurantEntity.setLastVisitDate(LocalDateTime.now()); wishListRepository.updateById(index, restaurantEntity); var result = wishListRepository.findById(index);