refactor(go): remove duplicate mileage history api

This commit is contained in:
lingniu
2026-07-02 21:34:12 +08:00
parent e27af63025
commit 7c41b81654
6 changed files with 24 additions and 286 deletions

View File

@@ -3,6 +3,7 @@ package main
import (
"context"
"encoding/json"
"os"
"strings"
"testing"
@@ -103,6 +104,16 @@ func TestKafkaTopicsFromEnvDefaultsToGoUnifiedTopic(t *testing.T) {
}
}
func TestRealtimeAPIDoesNotExposeDuplicateMileagePointRoute(t *testing.T) {
source, err := os.ReadFile("main.go")
if err != nil {
t.Fatalf("read main.go: %v", err)
}
if strings.Contains(string(source), "/api/history/mileage-points") {
t.Fatalf("realtime api should expose mileage through /api/history/locations only")
}
}
type contextCheckingRealtimeUpdater struct {
ctxErr error
count int