Expand description
v1.4.106 codex 1148 F5 (P2): 统一 stock_id ↔ Security 双向解析入口。
C++ 对照:
APIServer_Inner_API.cpp:604GetStockID(Security, &stock_id)— Security → stock_idAPIServer_Inner_API.cpp:669GetAPIStock(stock_id, &Security)— stock_id → Security- 两者底层都查
INNBiz_Qot_SecList::SearchSecBy{Code,ID}, 失败语义清晰 (enReturnRet != Ok即 fail), 不 silent drop。
Rust 既有实装把 id_to_key / securities 直接 pub 出去, push parser /
stock-filter / warrant / reference 各自查 + 各自处理 miss, 静默 drop
(filter_map / continue / 空 list 返客户端) → 后端返合法 stock_id 时无法
区分 “本地 cache miss” vs “后端真返空”, 难调试 + 用户感知差。
本 module 提供:
- bidir API —
resolve_stock_id_by_security/resolve_security_by_stock_id - loud miss — miss 时 bump counter (
resolver_miss_total), 加 stale mark (复用 mkt_id refresh 路径) - 明确返 enum 区分 hit / miss / unsupported — caller 必处理 miss (要么 reject, 要么 partial marker, 要么 trigger refresh)
Caller 重构 (后续 PR):
bridge/push_parser.rsquote push → resolver miss 时 counter + 不 silent drophandlers/qot/stock_filter.rs→ resolver miss 时返 partial 而非空 listhandlers/qot/warrant.rs→ reverse-lookup miss 时 reject (与 owner forward miss 一致)handlers/qot/misc.rs→ reverse-lookup miss 时 reject
Structs§
- Security
Ref - 轻量 Security 引用 (避免 caller 必须用 prost-generated 类型)。
- Security
Resolver - v1.4.106 codex 1148 F5 (P2): 统一 stock_id ↔ Security 双向解析。
Enums§
- Resolver
Err - stock_id ↔ Security 解析失败的原因。