feat(platform): expose missing source diagnosis

This commit is contained in:
lingniu
2026-07-04 06:00:06 +08:00
parent bf17c7437e
commit a60f87c9e7
8 changed files with 102 additions and 22 deletions

View File

@@ -66,17 +66,18 @@ Returns one vehicle service view with identity, realtime summary, source coverag
"sourceCount": 3,
"onlineSourceCount": 2,
"locatedSourceCount": 2,
"missingProtocols": ["YUTONG_MQTT"],
"mileageDeltaKm": 0.8,
"sourceTimeDeltaSeconds": 42,
"status": "degraded",
"severity": "warning",
"title": "部分来源离线",
"detail": "2/3 个来源在线,车辆服务可用但需要关注离线来源。"
"title": "来源不完整",
"detail": "2/3 个来源在线,车辆服务可用但缺少 YUTONG_MQTT 来源。"
}
}
```
`status` values are `consistent`, `degraded`, `offline`, `single_source`, `no_source`, `mileage_divergent`, and `time_divergent`. `severity` values are `ok`, `warning`, and `error`. `/api/vehicle-service/overview` and `/api/vehicle-service/overviews` also return `sourceConsistency`; overview responses may only include lightweight counts and diagnosis, while detail responses include location, mileage, and source-time deltas when realtime source rows are available.
`missingProtocols` lists canonical source evidence that is completely absent for the vehicle service, so callers can distinguish a missing source from an offline-but-known source. `status` values are `consistent`, `degraded`, `offline`, `single_source`, `no_source`, `mileage_divergent`, and `time_divergent`. `severity` values are `ok`, `warning`, and `error`. `/api/vehicle-service/overview` and `/api/vehicle-service/overviews` also return `sourceConsistency`; overview responses may only include lightweight counts and diagnosis, while detail responses include location, mileage, and source-time deltas when realtime source rows are available.
### Realtime Vehicles