fix(push-notification-list): 푸시 알림 조회 기간 타임존 기준을 로컬 1주로 통일한다
This commit is contained in:
@@ -17,7 +17,6 @@ import org.springframework.data.repository.findByIdOrNull
|
||||
import org.springframework.stereotype.Service
|
||||
import org.springframework.transaction.annotation.Transactional
|
||||
import java.time.LocalDateTime
|
||||
import java.time.ZoneOffset
|
||||
|
||||
@Service
|
||||
@Transactional(readOnly = true)
|
||||
@@ -82,7 +81,7 @@ class PushNotificationService(
|
||||
): GetPushNotificationListResponse {
|
||||
val parsedCategory = parseCategory(category)
|
||||
val languageCode = langContext.lang.code
|
||||
val fromDateTime = oneMonthAgoUtc()
|
||||
val fromDateTime = oneWeekAgo()
|
||||
|
||||
val totalCount = pushNotificationListRepository.getNotificationCount(
|
||||
memberId = member.id!!,
|
||||
@@ -110,7 +109,7 @@ class PushNotificationService(
|
||||
val localizedCategories = pushNotificationListRepository.getAvailableCategories(
|
||||
memberId = member.id!!,
|
||||
languageCode = lang.code,
|
||||
fromDateTime = oneMonthAgoUtc()
|
||||
fromDateTime = oneWeekAgo()
|
||||
).map { category ->
|
||||
messageSource.getMessage("push.notification.category.${category.code}", lang) ?: category.code
|
||||
}
|
||||
@@ -150,8 +149,8 @@ class PushNotificationService(
|
||||
}
|
||||
}
|
||||
|
||||
private fun oneMonthAgoUtc(): LocalDateTime {
|
||||
return LocalDateTime.now(ZoneOffset.UTC).minusMonths(1)
|
||||
private fun oneWeekAgo(): LocalDateTime {
|
||||
return LocalDateTime.now().minusWeeks(1)
|
||||
}
|
||||
|
||||
private fun resolveCategory(fcmEvent: FcmEvent): PushNotificationCategory? {
|
||||
|
||||
Reference in New Issue
Block a user