Files
suixinkan_uikit/suixinkan/Common/NotificationName.swift
T

78 lines
2.0 KiB
Swift

//
// NotificationName.swift
// suixinkan
//
import Foundation
/// 工程中所有 `NotificationCenter` 通知名称的统一入口。
/// 新增通知时只能在此文件声明,禁止在业务代码中硬编码字符串。
enum NotificationName {
private static let prefix = "com.yuanzhixiang.suixinkan."
private static func name(_ suffix: String) -> Notification.Name {
Notification.Name(prefix + suffix)
}
// MARK: - Session
/// 用户登录成功
static let userDidLogin = name("userDidLogin")
/// 用户主动退出登录
static let userDidLogout = name("userDidLogout")
/// 已登录状态下切换景区/门店账号
static let accountDidSwitch = name("accountDidSwitch")
/// Token 失效或鉴权失败,需重新登录
static let sessionDidExpire = name("sessionDidExpire")
// MARK: - Scenic
/// 当前景区切换
static let scenicDidChange = name("scenicDidChange")
// MARK: - User Profile
/// 用户资料更新(头像、昵称、角色等)
static let userProfileDidUpdate = name("userProfileDidUpdate")
// MARK: - Message
/// 未读消息数量变化
static let unreadMessageCountDidChange = name("unreadMessageCountDidChange")
// MARK: - Order
/// 订单状态或列表发生变化
static let orderDidUpdate = name("orderDidUpdate")
// MARK: - Task
/// 任务状态或列表发生变化
static let taskDidUpdate = name("taskDidUpdate")
// MARK: - Scenic Queue
/// 排队叫号数据变化
static let scenicQueueDidUpdate = name("scenicQueueDidUpdate")
// MARK: - Voice Call
/// 语音通话状态变化
static let voiceCallStateDidChange = name("voiceCallStateDidChange")
}
/// `Notification.userInfo` 字典键的统一入口。
enum NotificationUserInfoKey {
static let scenicId = "scenicId"
static let scenicName = "scenicName"
static let orderId = "orderId"
static let taskId = "taskId"
static let unreadCount = "unreadCount"
static let voiceCallState = "voiceCallState"
}