feat(platform): diagnose source consistency
This commit is contained in:
@@ -57,6 +57,27 @@ Returns one vehicle service view with identity, realtime summary, source coverag
|
||||
|
||||
`/api/vehicles/detail` remains available as a compatibility alias. New UI and integrations should use `/api/vehicle-service` to make the vehicle-first boundary explicit.
|
||||
|
||||
`sourceConsistency` is the vehicle-level diagnosis across GB32960, JT808, and Yutong MQTT sources. The three protocols are source evidence for one vehicle service, so callers should display the diagnosis result instead of asking users to compare protocol rows manually.
|
||||
|
||||
```json
|
||||
{
|
||||
"sourceConsistency": {
|
||||
"scope": "detail",
|
||||
"sourceCount": 3,
|
||||
"onlineSourceCount": 2,
|
||||
"locatedSourceCount": 2,
|
||||
"mileageDeltaKm": 0.8,
|
||||
"sourceTimeDeltaSeconds": 42,
|
||||
"status": "degraded",
|
||||
"severity": "warning",
|
||||
"title": "部分来源离线",
|
||||
"detail": "2/3 个来源在线,车辆服务可用但需要关注离线来源。"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
`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
|
||||
|
||||
```http
|
||||
|
||||
Reference in New Issue
Block a user