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

[DEV-286] TimeZone 관련 수정 #9

Merged
merged 2 commits into from
May 22, 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 @@ -11,6 +11,7 @@ import reactor.core.publisher.Mono
import java.time.Instant
import java.time.LocalDateTime
import java.time.ZoneId
import java.time.ZoneOffset
import java.util.UUID

@Service
Expand Down Expand Up @@ -49,7 +50,7 @@ class GetRankAndTokenUseCase @Autowired constructor(private val redisTemplate: R

private fun validateSalePeriod(ticketingId: UUID, currentTime: Long) : Mono<Boolean> {
val findById = ticketingRepository.findById(ticketingId)
val local = LocalDateTime.ofInstant(Instant.ofEpochMilli(currentTime), ZoneId.systemDefault())
val local = LocalDateTime.ofInstant(Instant.ofEpochMilli(currentTime), ZoneId.of("Asia/Seoul"))
return findById.flatMap { ticketing ->
if (ticketing.saleStart.isBefore(local) && ticketing.saleEnd.isAfter(local)) {
Mono.just(true)
Expand All @@ -58,4 +59,5 @@ class GetRankAndTokenUseCase @Autowired constructor(private val redisTemplate: R
}
}
}

}
Loading