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
|
||||
|
||||
@@ -22,6 +22,8 @@ Vehicle service coverage is always shown at VIN level. A vehicle may have one or
|
||||
|
||||
Vehicle lists should expose a vehicle-level service status derived from binding and source coverage: identity required, no data source, offline, degraded, or healthy. Protocol tags remain attribution and troubleshooting context, not the primary status.
|
||||
|
||||
Vehicle detail and top search context should expose one source-consistency conclusion, such as `来源一致`, `部分来源离线`, or `里程差异偏大`. This diagnosis comes from `sourceConsistency` and turns GB32960, JT808, and Yutong MQTT into explainable evidence under one vehicle service rather than three competing realtime products.
|
||||
|
||||
## Interaction Rules
|
||||
|
||||
- Tables are the default data surface.
|
||||
|
||||
Reference in New Issue
Block a user