fix: address code review findings
- Fix type mismatch in search_cache.go: SearchWithCache now returns *yandex.Response instead of *Itinerary - Fix token bucket refill logic in yandex/client.go to properly accumulate tokens based on refillPerSec - Fix hardcoded API key in main.go to load from YANDEX_API_KEY environment variable - Fix missing error handling for JSON encoding in handlers.go RouteGeoJSON function - Fix incorrect redis.Nil handling in cache/store.go CacheAside.Exists method - Fix incorrect error return type in station_status.go updateStationStatus to return newStatus instead of empty string
This commit is contained in:
12
internal/cache/preferences.go
vendored
12
internal/cache/preferences.go
vendored
@@ -21,11 +21,11 @@ type PreferenceSavedCity struct {
|
||||
|
||||
// PreferenceSearchHistory represents a user's search history entry.
|
||||
type PreferenceSearchHistory struct {
|
||||
Query string `json:"query"`
|
||||
FromCity string `json:"from_city"`
|
||||
ToCity string `json:"to_city"`
|
||||
Date string `json:"date"`
|
||||
CreatedAt int64 `json:"created_at"`
|
||||
Query string `json:"query"`
|
||||
FromCity string `json:"from_city"`
|
||||
ToCity string `json:"to_city"`
|
||||
Date string `json:"date"`
|
||||
CreatedAt int64 `json:"created_at"`
|
||||
}
|
||||
|
||||
// Preferences represents user preferences storage.
|
||||
@@ -265,4 +265,4 @@ func (p *Preferences) RemoveOldSearchHistory(ctx context.Context, userID string,
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user