Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] 어플리케이션/서버 시간 통일 #99

Merged
merged 2 commits into from
Feb 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,15 @@ public CommonResponseDto.RallyResponseDto certifyToPilgrimage(Long pilgrimageId,
List<VisitedPilgrimage> visitedPilgrimages = visitedPilgrimageRepository
.findByPilgrimageAndMemberOrderByCreatedAtDesc(pilgrimage, member);

for(VisitedPilgrimage vp:visitedPilgrimages){
log.info("인증객체:"+vp.getId()+vp.getMember().getNickname()+vp.getPilgrimage().getRallyName());
}

// 24시간 이내 방문이력 확인
Instant now = Instant.now();
// ZonedDateTime zonedDateTime = now.atZone(ZoneId.of("UTC"));
// log.info(zonedDateTime.toString());
ZonedDateTime zonedDateTime = now.atZone(ZoneId.of("UTC"));
log.info("UTC="+zonedDateTime.toString());
log.info("NOW="+LocalDateTime.now());

if (visitedPilgrimages.isEmpty()
|| (!visitedPilgrimages.isEmpty() && visitedPilgrimages.get(0).getPilgrimage().getCreatedAt().atZone(ZoneId.of("UTC")).plusHours(24L).isBefore(ZonedDateTime.now(ZoneId.of("UTC"))))) {
|| (!visitedPilgrimages.isEmpty()
&& visitedPilgrimages.get(0).getPilgrimage().getCreatedAt().plusHours(24L).isBefore(LocalDateTime.now()))) {
// 현재 좌표가 성지순례 장소 좌표 기준 +-0.00135 이내인지 확인
if (checkCoordinate(form, pilgrimage)){
throw new RestApiException(ErrorCode.PILGRIMAGE_CAN_NOT_CERTIFIED);
Expand Down
Loading