chore: update admin apis
This commit is contained in:
@@ -22,6 +22,7 @@ var ErrAdminUserNotFound = errors.New("user not found")
|
||||
// feedback-reply email — no new infrastructure.
|
||||
type AdminService struct {
|
||||
repo *repository.AdminRepo
|
||||
stats *repository.StatsRepo
|
||||
notif *NotificationService
|
||||
feedback *FeedbackService
|
||||
mail mailer.Mailer
|
||||
@@ -29,8 +30,15 @@ type AdminService struct {
|
||||
frontendURL string
|
||||
}
|
||||
|
||||
func NewAdminService(repo *repository.AdminRepo, notif *NotificationService, feedback *FeedbackService, mail mailer.Mailer, logger *zap.Logger, frontendURL string) *AdminService {
|
||||
return &AdminService{repo: repo, notif: notif, feedback: feedback, mail: mail, logger: logger, frontendURL: frontendURL}
|
||||
func NewAdminService(repo *repository.AdminRepo, stats *repository.StatsRepo, notif *NotificationService, feedback *FeedbackService, mail mailer.Mailer, logger *zap.Logger, frontendURL string) *AdminService {
|
||||
return &AdminService{repo: repo, stats: stats, notif: notif, feedback: feedback, mail: mail, logger: logger, frontendURL: frontendURL}
|
||||
}
|
||||
|
||||
// Stats returns the system snapshot (counts + 7-day deltas + feedback
|
||||
// breakdown) — the same data the public /stats page renders, as JSON for the
|
||||
// admin dashboard home.
|
||||
func (s *AdminService) Stats(ctx context.Context) (*repository.StatsSnapshot, error) {
|
||||
return s.stats.Snapshot(ctx)
|
||||
}
|
||||
|
||||
// AcknowledgeFeedback marks a feedback row acknowledged and emails the author
|
||||
|
||||
Reference in New Issue
Block a user