feat(platform): add vehicle detail aggregate api

This commit is contained in:
lingniu
2026-07-03 21:34:50 +08:00
parent 0438d054f6
commit d4bd70fdf4
7 changed files with 147 additions and 51 deletions

View File

@@ -8,6 +8,7 @@ import type {
QualityIssueRow,
RawFrameRow,
RealtimeLocationRow,
VehicleDetail,
VehicleRow
} from './types';
@@ -23,6 +24,7 @@ async function request<T>(path: string, init?: RequestInit): Promise<T> {
export const api = {
dashboardSummary: () => request<DashboardSummary>('/api/dashboard/summary'),
vehicles: (params = new URLSearchParams()) => request<Page<VehicleRow>>(`/api/vehicles?${params.toString()}`),
vehicleDetail: (params = new URLSearchParams()) => request<VehicleDetail>(`/api/vehicles/detail?${params.toString()}`),
realtimeLocations: (params = new URLSearchParams()) => request<Page<RealtimeLocationRow>>(`/api/realtime/locations?${params.toString()}`),
historyLocations: (params = new URLSearchParams()) => request<Page<HistoryLocationRow>>(`/api/history/locations?${params.toString()}`),
rawFrames: (params = new URLSearchParams()) => request<Page<RawFrameRow>>(`/api/history/raw-frames?${params.toString()}`),