feat(ios): add cross-instance notification center

This commit is contained in:
chick
2026-09-09 01:13:45 +08:00
parent 84ec3678c0
commit cf187e42fa
9 changed files with 1114 additions and 3 deletions
@@ -12,16 +12,24 @@ public enum UpstreamRoute: Hashable, Sendable {
case smsList(limit: Int, offset: Int, direction: String?)
case smsSend(phoneNumber: String, content: String)
case smsBatchDelete(ids: [Int])
case notificationConfig
case notificationLogs(limit: Int, offset: Int)
case notificationQueue(limit: Int)
case notificationRetryAllQueue
case notificationRetryQueue(id: String)
case notificationDeleteQueue(id: String)
case authLogin(password: String)
case authLogout
public var method: String {
switch self {
case .health, .device, .sim, .network, .signalStrength, .stats, .statsCpu,
.connectivity, .smsList:
.connectivity, .smsList, .notificationConfig, .notificationLogs, .notificationQueue:
return "GET"
case .smsSend, .smsBatchDelete, .authLogin, .authLogout:
case .smsSend, .smsBatchDelete, .notificationRetryAllQueue, .notificationRetryQueue, .authLogin, .authLogout:
return "POST"
case .notificationDeleteQueue:
return "DELETE"
}
}
@@ -43,6 +51,17 @@ public enum UpstreamRoute: Hashable, Sendable {
return "/api/sms/list?\(items.joined(separator: "&"))"
case .smsSend: return "/api/sms/send"
case .smsBatchDelete: return "/api/sms/batch-delete"
case .notificationConfig: return "/api/notifications/config"
case .notificationLogs(let limit, let offset):
return "/api/notifications/logs?limit=\(limit)&offset=\(offset)"
case .notificationQueue(let limit):
return "/api/notifications/queue?limit=\(limit)"
case .notificationRetryAllQueue:
return "/api/notifications/queue/retry-all"
case .notificationRetryQueue(let id):
return "/api/notifications/queue/\(id)/retry"
case .notificationDeleteQueue(let id):
return "/api/notifications/queue/\(id)"
case .authLogin: return "/api/auth/login"
case .authLogout: return "/api/auth/logout"
}