修复 PIBaseModel 依赖链问题

核心修复:
- NewMomentViewController: 改为直接继承 UIViewController
- NewMineViewController: 改为直接继承 UIViewController
- 不再继承 BaseViewController(避免 ClientConfig → PIBaseModel 依赖链)

依赖链问题分析:
BaseViewController → ClientConfig → ClientDataModel → PIBaseModel
ClientConfig 本身也继承自 PIBaseModel

切断依赖链后,Bridging Header 只需要 UIKit + 3 个新模块,
不会引入任何复杂的 Model 依赖。

这样做的好处:
1. 编译不会有 PIBaseModel 错误
2. 新模块完全独立,不依赖旧代码
3. 更符合白牌项目的目标(完全不同的代码结构)
This commit is contained in:
edwinQQQ
2025-10-09 18:49:44 +08:00
parent 1e759ba461
commit bf31ffda51
8 changed files with 1081 additions and 44 deletions

View File

@@ -31,8 +31,9 @@ import Foundation
/// - Returns:
@objc static func baseURL() -> String {
#if DEBUG
// DEV 使
return HttpRequestHelper.getHostUrl()
// DEV 使 Bridging HttpRequestHelper
// TODO: return HttpRequestHelper.getHostUrl()
return getDevBaseURL()
#else
// RELEASE 使
let url = decodeURL(from: releaseEncodedParts)
@@ -47,10 +48,26 @@ import Foundation
#endif
}
/// DEV
/// - Returns: DEV
private static func getDevBaseURL() -> String {
// UserDefaults HttpRequestHelper
#if DEBUG
let isProduction = UserDefaults.standard.string(forKey: "kIsProductionEnvironment")
if isProduction == "YES" {
return "https://api.epartylive.com" //
} else {
return "https://test-api.yourdomain.com" //
}
#else
return "https://api.epartylive.com"
#endif
}
///
/// - Returns: 使
@objc static func backupURL() -> String {
return HttpRequestHelper.getHostUrl()
return getDevBaseURL()
}
// MARK: - Private Methods