feat(platform): add vehicle coverage view

This commit is contained in:
lingniu
2026-07-03 21:54:09 +08:00
parent 6352289c25
commit 110041a9db
13 changed files with 223 additions and 5 deletions

View File

@@ -27,6 +27,7 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
func (h *Handler) routes() {
h.mux.HandleFunc("GET /api/dashboard/summary", h.handleDashboardSummary)
h.mux.HandleFunc("GET /api/vehicles", h.handleVehicles)
h.mux.HandleFunc("GET /api/vehicles/coverage", h.handleVehicleCoverage)
h.mux.HandleFunc("GET /api/vehicles/detail", h.handleVehicleDetail)
h.mux.HandleFunc("GET /api/realtime/locations", h.handleRealtimeLocations)
h.mux.HandleFunc("GET /api/history/locations", h.handleHistoryLocations)
@@ -47,6 +48,11 @@ func (h *Handler) handleVehicles(w http.ResponseWriter, r *http.Request) {
h.write(w, r, data, err)
}
func (h *Handler) handleVehicleCoverage(w http.ResponseWriter, r *http.Request) {
data, err := h.service.VehicleCoverage(r.Context(), r.URL.Query())
h.write(w, r, data, err)
}
func (h *Handler) handleVehicleDetail(w http.ResponseWriter, r *http.Request) {
vin := strings.TrimSpace(r.URL.Query().Get("vin"))
if vin == "" {