Skip to content

Commit

Permalink
addVisit 수정하기
Browse files Browse the repository at this point in the history
- 방문할 때 마다, lastVisitDate 수정해주기

Related to: #37
  • Loading branch information
ahyoon99 committed Sep 5, 2024
1 parent 72899b2 commit 2cbbc5f
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 2cbbc5f

Please sign in to comment.