chore: update admin apis
This commit is contained in:
@@ -17,22 +17,22 @@ func NewStatsRepo(pg *Postgres) *StatsRepo { return &StatsRepo{pg: pg} }
|
||||
// StatsSnapshot bundles totals, last-7-days counts, and feedback
|
||||
// category breakdowns. One value rendered by /stats per request.
|
||||
type StatsSnapshot struct {
|
||||
Users int
|
||||
UsersLast7Days int
|
||||
Posts int
|
||||
PostsLast7Days int
|
||||
Collections int
|
||||
PublicCollections int
|
||||
Bookmarks int
|
||||
Reshares int
|
||||
Feedback int
|
||||
FeedbackLast7Days int
|
||||
FeedbackByCategory []CategoryCount
|
||||
Users int `json:"users"`
|
||||
UsersLast7Days int `json:"users_last_7_days"`
|
||||
Posts int `json:"posts"`
|
||||
PostsLast7Days int `json:"posts_last_7_days"`
|
||||
Collections int `json:"collections"`
|
||||
PublicCollections int `json:"public_collections"`
|
||||
Bookmarks int `json:"bookmarks"`
|
||||
Reshares int `json:"reshares"`
|
||||
Feedback int `json:"feedback"`
|
||||
FeedbackLast7Days int `json:"feedback_last_7_days"`
|
||||
FeedbackByCategory []CategoryCount `json:"feedback_by_category"`
|
||||
}
|
||||
|
||||
type CategoryCount struct {
|
||||
Category string
|
||||
Count int
|
||||
Category string `json:"category"`
|
||||
Count int `json:"count"`
|
||||
}
|
||||
|
||||
// Snapshot runs every count needed by /stats. Queries run in series —
|
||||
|
||||
Reference in New Issue
Block a user