feat(platform): add batch vehicle overview api

This commit is contained in:
lingniu
2026-07-04 03:05:27 +08:00
parent 1a86e5d38c
commit f996fa0df9
5 changed files with 141 additions and 0 deletions

View File

@@ -30,6 +30,13 @@ export type RawFrameQuery = {
offset?: number;
};
export type VehicleOverviewBatchQuery = {
keywords: string[];
protocol?: string;
limit?: number;
offset?: number;
};
type ApiErrorEnvelope = {
error?: {
code?: string;
@@ -77,6 +84,11 @@ export const api = {
vehicleCoverage: (params = new URLSearchParams()) => request<Page<VehicleCoverageRow>>(`/api/vehicles/coverage?${params.toString()}`),
vehicleDetail: (params = new URLSearchParams()) => request<VehicleDetail>(`/api/vehicle-service?${params.toString()}`),
vehicleServiceOverview: (params = new URLSearchParams()) => request<VehicleServiceOverview>(`/api/vehicle-service/overview?${params.toString()}`),
vehicleServiceOverviews: (query: VehicleOverviewBatchQuery) => request<Page<VehicleServiceOverview>>('/api/vehicle-service/overviews', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(query)
}),
vehicleRealtime: (params = new URLSearchParams()) => request<Page<VehicleRealtimeRow>>(`/api/realtime/vehicles?${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()}`),