fix(channel-donation): 후원 조회 월 경계를 UTC 전달 기준으로 보정한다
This commit is contained in:
@@ -63,13 +63,23 @@ class ChannelDonationService(
|
||||
memberRepository.findCreatorByIdOrNull(creatorId)
|
||||
?: throw SodaException(messageKey = "member.validation.creator_not_found")
|
||||
|
||||
val utcZoneId = ZoneId.of("UTC")
|
||||
val kstZoneId = ZoneId.of("Asia/Seoul")
|
||||
val nowKst = ZonedDateTime.now(kstZoneId)
|
||||
val startDateTime = nowKst
|
||||
val nowUtc = ZonedDateTime.now(utcZoneId)
|
||||
val nowKst = nowUtc.withZoneSameInstant(kstZoneId)
|
||||
|
||||
val startDateTimeKst = nowKst
|
||||
.with(TemporalAdjusters.firstDayOfMonth())
|
||||
.toLocalDate()
|
||||
.atStartOfDay()
|
||||
val endDateTime = startDateTime.plusMonths(1)
|
||||
.atStartOfDay(kstZoneId)
|
||||
val endDateTimeKst = startDateTimeKst.plusMonths(1)
|
||||
|
||||
val startDateTime = startDateTimeKst
|
||||
.withZoneSameInstant(utcZoneId)
|
||||
.toLocalDateTime()
|
||||
val endDateTime = endDateTimeKst
|
||||
.withZoneSameInstant(utcZoneId)
|
||||
.toLocalDateTime()
|
||||
val isCreator = member.role == MemberRole.CREATOR && creatorId == member.id
|
||||
|
||||
val totalCount = channelDonationMessageRepository.getChannelDonationMessageTotalCount(
|
||||
|
||||
Reference in New Issue
Block a user