fix: map CoinGlass heatmap range bounds
Some checks failed
ci / build + vet + guard + race (push) Has been cancelled

This commit is contained in:
dela
2026-05-25 22:06:21 +08:00
parent 7e31e9cbaf
commit b15d763287
2 changed files with 4 additions and 4 deletions

View File

@@ -26,7 +26,7 @@ type CGEnvelope struct {
// 真实响应的 plaintext 是 data 本体(例如 {"instrument":...,"liq":[...]})。
// 为兼容早期 fixture如 plaintext 仍带 success/code/data envelope则先拆 data。
// PR-1 阶段做最薄映射data 整体进 RawGrid
// 若顶层有 minPrice/maxPrice/priceMin/priceMax 字段则抽出(容忍命名漂移)。
// 若顶层有 rangeLow/rangeHigh/minPrice/maxPrice/priceMin/priceMax 字段则抽出(容忍命名漂移)。
// 真实 schema 经 spike dump 后回填到 spec §5mapper 同步加显式字段)。
//
// 数值边界ADR-0004 D3解 JSON number 默认 float64 是 transient
@@ -45,8 +45,8 @@ func MapLiqHeatMap(symbol string, interval string, ts int64, plaintext []byte) (
var probe map[string]json.RawMessage
if err := json.Unmarshal(raw, &probe); err == nil {
out.PriceMin = pickFloatField(probe, "priceMin", "minPrice", "min")
out.PriceMax = pickFloatField(probe, "priceMax", "maxPrice", "max")
out.PriceMin = pickFloatField(probe, "priceMin", "rangeLow", "minPrice", "min")
out.PriceMax = pickFloatField(probe, "priceMax", "rangeHigh", "maxPrice", "max")
}
return out, nil
}