2026-04-21 22:07:29 +08:00
|
|
|
import Foundation
|
|
|
|
|
|
|
|
|
|
public struct SDKConfig: Sendable {
|
|
|
|
|
public let appKey: String
|
|
|
|
|
public let appSecret: String
|
|
|
|
|
public let debug: Bool
|
|
|
|
|
|
|
|
|
|
public init(
|
|
|
|
|
appKey: String,
|
|
|
|
|
appSecret: String,
|
|
|
|
|
debug: Bool = false
|
|
|
|
|
) {
|
|
|
|
|
self.appKey = appKey
|
|
|
|
|
self.appSecret = appSecret
|
|
|
|
|
self.debug = debug
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-04-28 16:08:06 +08:00
|
|
|
|
|
|
|
|
public extension SDKConfig {
|
|
|
|
|
static func development(
|
2026-04-29 15:46:39 +08:00
|
|
|
appKey: String,
|
2026-04-28 16:08:06 +08:00
|
|
|
appSecret: String,
|
|
|
|
|
debug: Bool = false
|
|
|
|
|
) -> SDKConfig {
|
|
|
|
|
SDKConfig(
|
2026-04-29 15:46:39 +08:00
|
|
|
appKey: appKey,
|
2026-04-28 16:08:06 +08:00
|
|
|
appSecret: appSecret,
|
|
|
|
|
debug: debug
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-04-29 15:46:39 +08:00
|
|
|
|
|
|
|
|
extension SDKConfig {
|
|
|
|
|
var appId: String { appKey }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
enum SDKEndpoints {
|
|
|
|
|
static let apiBaseURL = URL(string: "https://dev.xuqinmin.com")!
|
|
|
|
|
static let imWebSocketURL = URL(string: "wss://dev.xuqinmin.com/ws/im")!
|
|
|
|
|
}
|