feat(platform): add online statistics summary

This commit is contained in:
lingniu
2026-07-04 16:57:11 +08:00
parent d7f1a9279f
commit 9ac2b90d12
8 changed files with 146 additions and 9 deletions

View File

@@ -745,6 +745,7 @@ func TestHandlerHistoryMileageQualityOps(t *testing.T) {
{"/api/history/raw-frames?protocol=GB32960&vin=LB9A32A24R0LS1426&limit=1&includeFields=true", "plate"},
{"/api/mileage/summary?limit=10", "totalMileageKm"},
{"/api/mileage/daily?limit=10", "dailyMileageKm"},
{"/api/statistics/online-summary?limit=10", "onlineRatePercent"},
{"/api/quality/summary?limit=10", "issueVehicleCount"},
{"/api/quality/issues?limit=10", "sourceEndpoint"},
{"/api/ops/health", "linkHealth"},
@@ -894,12 +895,12 @@ func TestHandlerQualityNotificationPlan(t *testing.T) {
func TestHandlerOpsHealthIncludesVehicleServiceRuntime(t *testing.T) {
handler := NewHandler(NewServiceWithRuntime(NewMockStore(), RuntimeInfo{
RequestTimeoutMs: 1500,
AMapWebJSConfigured: true,
AMapSecurityProxyEnabled: true,
AMapSecurityCodeExposed: false,
AMapSecurityServiceHost: "/_AMapService",
PlatformRelease: "platform-20260704153005",
RequestTimeoutMs: 1500,
AMapWebJSConfigured: true,
AMapSecurityProxyEnabled: true,
AMapSecurityCodeExposed: false,
AMapSecurityServiceHost: "/_AMapService",
PlatformRelease: "platform-20260704153005",
}))
rec := httptest.NewRecorder()
req := httptest.NewRequest(http.MethodGet, "/api/ops/health", nil)