feat(platform): return service status in vehicle overview

This commit is contained in:
lingniu
2026-07-04 03:00:50 +08:00
parent 8dfbdc83e5
commit 1a86e5d38c
7 changed files with 65 additions and 19 deletions

View File

@@ -224,6 +224,9 @@ func TestHandlerVehicleServiceOverviewEndpoint(t *testing.T) {
if body.Data.SourceCount != 2 || body.Data.OnlineSourceCount != 1 || body.Data.CoverageStatus != "partial" {
t.Fatalf("overview endpoint should summarize vehicle service coverage, got %+v", body.Data)
}
if body.Data.ServiceStatus == nil || body.Data.ServiceStatus.Status != "degraded" || body.Data.ServiceStatus.Title != "部分来源离线" {
t.Fatalf("overview endpoint should expose canonical service status, got %+v", body.Data.ServiceStatus)
}
if strings.Contains(rec.Body.String(), `"raw"`) || strings.Contains(rec.Body.String(), `"history"`) {
t.Fatalf("overview endpoint should not return heavy detail pages: %s", rec.Body.String())
}