diff --git a/internal/locations/repo.go b/internal/locations/repo.go index 2c9313d..7213aa9 100644 --- a/internal/locations/repo.go +++ b/internal/locations/repo.go @@ -79,12 +79,12 @@ func (r *Repo) Get(ctx context.Context, userID uuid.UUID) (*Location, error) { // Оптимизация: фильтруем сначала по bounding-box (lat/lng), потом haversine только для отфильтрованных. // Это устраняет двойной расчёт haversine и даёт индекс если добавить GiST/btree на lat,lng. type Nearby struct { - UserID uuid.UUID - Name string - PhotoURL string - Lat float64 - Lng float64 - DistanceM float64 + UserID uuid.UUID `json:"user_id"` + Name string `json:"name"` + PhotoURL string `json:"photo_url"` + Lat float64 `json:"lat"` + Lng float64 `json:"lng"` + DistanceM float64 `json:"distance_m"` } func (r *Repo) Nearby(ctx context.Context, myID uuid.UUID, lat, lng, radiusKm float64, limit int) ([]Nearby, error) {