541d08a014
continuous-integration/drone/push Build is passing
- Added new field `Days` and `ScrapedTED` to `SummaryResponse` for tracking daily TED scrape counts. - Updated `SummaryQuery` to include `Days` parameter for querying scraped TED data. - Modified `Summary` handler to accept and process the new `Days` parameter. - Refactored `Summary` method in the repository to support the new `Days` parameter and improved aggregation logic. - Enhanced caching logic in the service layer to utilize a composite cache key based on `closingWindowSec` and `days`, improving cache management and retrieval efficiency. This update improves the dashboard's functionality by providing more detailed insights into TED scraping activities and optimizing the caching strategy for better performance.
36 lines
907 B
Go
36 lines
907 B
Go
package dashboard
|
|
|
|
// SummaryQuery binds query params for GET /dashboard/summary.
|
|
type SummaryQuery struct {
|
|
ClosingWindow int `query:"closing_window"`
|
|
Days int `query:"days"`
|
|
}
|
|
|
|
// TrendQuery binds query params for GET /dashboard/trend.
|
|
type TrendQuery struct {
|
|
Days int `query:"days"`
|
|
Metric string `query:"metric"`
|
|
}
|
|
|
|
// CountriesQuery binds query params for GET /dashboard/countries.
|
|
type CountriesQuery struct {
|
|
Limit int `query:"limit"`
|
|
}
|
|
|
|
// ClosingSoonQuery binds query params for GET /dashboard/closing-soon.
|
|
type ClosingSoonQuery struct {
|
|
Limit int `query:"limit"`
|
|
Window int `query:"window"`
|
|
}
|
|
|
|
// RecentQuery binds query params for GET /dashboard/recent.
|
|
type RecentQuery struct {
|
|
Limit int `query:"limit"`
|
|
Cursor string `query:"cursor"`
|
|
}
|
|
|
|
// StatisticsQuery binds query params for GET /dashboard/statistics.
|
|
type StatisticsQuery struct {
|
|
Days int `query:"days"`
|
|
}
|