feat: CI/CD pipeline + Learning/Medicine/Travel services
- Add Gitea Actions workflow for automated build & deploy - Add K8s manifests: webui, travel-svc, medicine-svc, sandbox-svc - Update kustomization for localhost:5000 registry - Add ingress for gooseek.ru and api.gooseek.ru - Learning cabinet with onboarding, courses, sandbox integration - Medicine service with symptom analysis and doctor matching - Travel service with itinerary planning - Server setup scripts (NVIDIA/CUDA, K3s, Gitea runner) Made-with: Cursor
This commit is contained in:
@@ -36,6 +36,8 @@ func CollectHotelsEnriched(ctx context.Context, cfg TravelOrchestratorConfig, br
|
||||
|
||||
hotels = deduplicateHotels(hotels)
|
||||
|
||||
hotels = filterHotelsNearDestinations(hotels, destinations, 250)
|
||||
|
||||
if len(hotels) > 10 {
|
||||
hotels = hotels[:10]
|
||||
}
|
||||
@@ -400,6 +402,34 @@ func geocodeHotels(ctx context.Context, cfg TravelOrchestratorConfig, hotels []H
|
||||
return hotels
|
||||
}
|
||||
|
||||
func filterHotelsNearDestinations(hotels []HotelCard, destinations []destGeoEntry, maxKm float64) []HotelCard {
|
||||
if len(destinations) == 0 {
|
||||
return hotels
|
||||
}
|
||||
filtered := make([]HotelCard, 0, len(hotels))
|
||||
for _, h := range hotels {
|
||||
if h.Lat == 0 && h.Lng == 0 {
|
||||
continue
|
||||
}
|
||||
minD := 1e18
|
||||
for _, d := range destinations {
|
||||
if d.Lat == 0 && d.Lng == 0 {
|
||||
continue
|
||||
}
|
||||
dd := distanceKm(h.Lat, h.Lng, d.Lat, d.Lng)
|
||||
if dd < minD {
|
||||
minD = dd
|
||||
}
|
||||
}
|
||||
if minD <= maxKm {
|
||||
filtered = append(filtered, h)
|
||||
} else {
|
||||
log.Printf("[travel-hotels] dropped far hotel '%s' (%.0fkm from destinations)", h.Name, minD)
|
||||
}
|
||||
}
|
||||
return filtered
|
||||
}
|
||||
|
||||
func deduplicateHotels(hotels []HotelCard) []HotelCard {
|
||||
seen := make(map[string]bool)
|
||||
var unique []HotelCard
|
||||
|
||||
Reference in New Issue
Block a user