Visual_Novel_iOS/crush/Crush/Src/Utils/Router/AppRouterChat.swift

48 lines
1.8 KiB
Swift

//
// AppRouterChat.swift
// Crush
//
// Created by Leon on 2025/8/15.
//
import Foundation
extension AppRouter{
static func goNoticeCenter(){
guard UserCore.shared.checkUserLoginIfNotPushUserToLogin() else{return}
let vc = NoticeCenterListController()
UIWindow.getTopNavigationController()?.pushViewController(vc, animated: true)
}
static func goChatVC(accId: String, complete: (() -> Void)? = nil) {
guard UserCore.shared.checkUserLoginIfNotPushUserToLogin() else{return}
let vc = SessionController(accountID: accId)
let nvc = UIWindow.getTopViewController(base: UIWindow.applicationKey?.rootViewController)?.navigationController
nvc?.pushViewController(vc, animated: true)
complete?()
}
static func goChatVC(aiId: Int?, complete: (() -> Void)? = nil) {
guard UserCore.shared.checkUserLoginIfNotPushUserToLogin() else{return}
guard let aiUserId = aiId, let accId = IMUserKit.accountIdWithAIId(aiId: aiUserId) else{return}
let vc = SessionController(accountID: accId)
let nvc = UIWindow.getTopViewController(base: UIWindow.applicationKey?.rootViewController)?.navigationController
nvc?.pushViewController(vc, animated: true)
complete?()
}
static func goChatVC(conversationId: String?, complete: (() -> Void)? = nil) {
guard UserCore.shared.checkUserLoginIfNotPushUserToLogin() else{return}
guard let sessionId = conversationId else{return}
let vc = SessionController(conversationId: sessionId)
let nvc = UIWindow.getTopViewController(base: UIWindow.applicationKey?.rootViewController)?.navigationController
nvc?.pushViewController(vc, animated: true)
complete?()
}
}