refactor(go): remove duplicate mileage history api

This commit is contained in:
lingniu
2026-07-02 21:34:12 +08:00
parent e27af63025
commit 7c41b81654
6 changed files with 24 additions and 286 deletions

View File

@@ -32,7 +32,7 @@
1. `vehicle_mileage_points``vehicle_locations.total_mileage_km` 重复。
- 状态Go 写入链路已停止创建和写入 `vehicle_mileage_points`
- 兼容:`/api/history/mileage-points` 已改为从 `vehicle_locations` 读取 `total_mileage_km IS NOT NULL`
- 查询:不再暴露单独 `/api/history/mileage-points`,里程点直接从 `/api/history/locations` `total_mileage_km` 获取
- 生产ECS TDengine 历史库已在上线前重建,`vehicle_mileage_points` 不再存在。
2. `raw_frames.fields_json``raw_frames.parsed_json``vehicle_locations` 重复。

View File

@@ -649,8 +649,7 @@
<thead><tr><th>接口类型</th><th>数据源</th><th>说明</th></tr></thead>
<tbody>
<tr><td>RAW 帧查询</td><td>TDengine raw_frames + chunks</td><td>按协议、VIN/phone、时间、消息类型分页。</td></tr>
<tr><td>位置历史</td><td>TDengine vehicle_locations</td><td>高频位置分页查询,避免每次扫完整 JSON</td></tr>
<tr><td>里程历史</td><td>TDengine vehicle_locations</td><td>从位置核心表读取总里程点,不再单独维护里程点表。</td></tr>
<tr><td>位置/总里程历史</td><td>TDengine vehicle_locations</td><td>高频位置分页查询,包含 total_mileage_km避免重复里程点接口</td></tr>
<tr><td>每日里程</td><td>MySQL vehicle_daily_mileage</td><td>按日期、协议查询首末总里程差值结果。</td></tr>
</tbody>
</table>