1.11 修订:VersionResolver 改单链 4 层 fallback,删除双子树合并算法(契约影响)
【契约影响】 - RemoteConfig 模型:Agent 节点移除 channellist 字段(线上 JSON 实际只挂 gamelist;此前误读 chulishengji 引入的 channellist 是空 schema) - VersionResolver 解析算法:从"双子树 + 字段级合并"改为"agentlist → gamelist → channellist → marketlist 单链 4 层 fallback",行为按 daoqi NewRootVC.m:689-810 主路径 - 对外 API ResolvedVersion / resolve(config:agentId:channelId:marketId:gameId:) 签名零变化,WebContainerViewController / SubGameViewController 调用点未动 【设计要点】 - 4 节点类型 conform 同一 private protocol RemoteConfigNode - 5 字段共用 pickString / pickInt 两个倒序 fallback 工具,不允许为某字段单独写 if 链 - buildChain 集中处理"任一层 id 不匹配立刻截断"语义 【文档同步】 - Design §6.3.2 整段重写 - Plan ADR-008 顶部追加"第三轮修订(2026-06-27)"小节 + 第二轮误读复盘 - Plan ADR-008-D 替换为单链 4 层算法说明 + 保留修订史 - Plan §1.11 / ADR-008-I / 最后更新日期 / Verification-Checklist L73 同步 参考契约章节:docs/H5-Native-Implementation-Design.md §6.3.2、docs/Development-Plan.md ADR-008-D BuildProject 通过。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
90a523736e
commit
8125dd4d11
@@ -8,7 +8,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
// MARK: - Codable 模型(三级嵌套:agent → channel → market;agent 子树另有 gamelist 副路径)
|
||||
// MARK: - Codable 模型(单链 4 层嵌套:agent → game → channel → market)
|
||||
|
||||
nonisolated public struct RemoteConfig: Codable, Sendable {
|
||||
public let showmessage: String?
|
||||
@@ -22,7 +22,6 @@ nonisolated public struct Agent: Codable, Sendable {
|
||||
public let appDownload: String?
|
||||
public let gameVersion: String?
|
||||
public let gameZip: String?
|
||||
public let channellist: [Channel]?
|
||||
public let gamelist: [Game]?
|
||||
|
||||
public init(from decoder: any Decoder) throws {
|
||||
@@ -33,12 +32,11 @@ nonisolated public struct Agent: Codable, Sendable {
|
||||
appDownload = try c.decodeFlexibleStringIfPresent(forKey: .appDownload)
|
||||
gameVersion = try c.decodeFlexibleStringIfPresent(forKey: .gameVersion)
|
||||
gameZip = try c.decodeFlexibleStringIfPresent(forKey: .gameZip)
|
||||
channellist = try c.decodeIfPresent([Channel].self, forKey: .channellist)
|
||||
gamelist = try c.decodeIfPresent([Game].self, forKey: .gamelist)
|
||||
}
|
||||
|
||||
private enum CodingKeys: String, CodingKey {
|
||||
case agentid, showmessage, channellist, gamelist
|
||||
case agentid, showmessage, gamelist
|
||||
case appVersion, appDownload, gameVersion, gameZip
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user