feat(platform): add vehicle coverage view
This commit is contained in:
@@ -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 == "" {
|
||||
|
||||
Reference in New Issue
Block a user