feat(notification): 알림함 진입 및 딥링크 라우팅을 추가한다

This commit is contained in:
Yu Sung
2026-03-12 18:35:43 +09:00
parent 2b58a0147b
commit af8813685e
20 changed files with 788 additions and 32 deletions

View File

@@ -0,0 +1,42 @@
import Foundation
struct GetPushNotificationListResponse: Decodable {
let totalCount: Int
let items: [PushNotificationListItem]
}
struct PushNotificationListItem: Decodable {
let id: Int
let senderNickname: String
let senderProfileImage: String?
let message: String
let category: String
let deepLink: String?
let sentAt: String
}
extension PushNotificationListItem {
func relativeSentAtText(now: Date = Date()) -> String {
guard let sentDate = DateParser.parse(sentAt) else {
return sentAt
}
let interval = max(0, now.timeIntervalSince(sentDate))
if interval < 60 {
return I18n.Time.justNow
}
if interval < 3600 {
let minutes = max(1, Int(interval / 60))
return I18n.Time.minutesAgo(minutes)
}
if interval < 86_400 {
let hours = max(1, Int(interval / 3600))
return I18n.Time.hoursAgo(hours)
}
let days = max(1, Int(interval / 86_400))
return I18n.Time.daysAgo(days)
}
}