diff --git a/offroad-api/src/main/java/site/offload/api/member/usecase/AuthAdventureUseCase.java b/offroad-api/src/main/java/site/offload/api/member/usecase/AuthAdventureUseCase.java index 7b9f2e8f..189be931 100644 --- a/offroad-api/src/main/java/site/offload/api/member/usecase/AuthAdventureUseCase.java +++ b/offroad-api/src/main/java/site/offload/api/member/usecase/AuthAdventureUseCase.java @@ -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; @@ -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; }