Skip to content

Commit

Permalink
Merge pull request #9 from Tiketeer/feat/DEV-286
Browse files Browse the repository at this point in the history
[DEV-286] TimeZone 관련 수정
  • Loading branch information
claycat authored May 22, 2024
2 parents 5503451 + 67d657a commit 0b9a50b
Showing 1 changed file with 3 additions and 1 deletion.
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
}
}
}

}

0 comments on commit 0b9a50b

Please sign in to comment.