Skip to content

Commit

Permalink
fix : 하루 한 번만 할 수 있도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
sansan20535 committed Dec 23, 2024
1 parent f40bc73 commit f04862e
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import site.offload.external.aws.S3Service;

import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
Expand Down Expand Up @@ -123,12 +124,11 @@ private boolean isFirstVisitToday(MemberEntity findMemberEntity, PlaceEntity fin
if (lastVisitedPlaceEntity == null) {
return true;
}
if (LocalDateTime.now().getMinute() - lastVisitedPlaceEntity.getCreatedAt().getMinute() < 1) {
// 날짜 부분만 비교
long daysBetween = ChronoUnit.DAYS.between(lastVisitedPlaceEntity.getCreatedAt().toLocalDate(), LocalDateTime.now().toLocalDate());
if (Math.abs(daysBetween) == 0) {
return false;
}
/* if (LocalDateTime.now().getDayOfMonth() - lastVisitedPlaceEntity.getCreatedAt().getDayOfMonth() == 0) {
return false;
}*/
return true;
}

Expand Down

0 comments on commit f04862e

Please sign in to comment.