fix: 管理员活跃时间记录

This commit is contained in:
yokowu
2025-07-17 16:45:27 +08:00
parent d447fa4a11
commit 5cd90f681c
12 changed files with 79 additions and 33 deletions

View File

@@ -15,11 +15,12 @@ func NewDashboardHandler(
w *web.Web,
usecase domain.DashboardUsecase,
auth *middleware.AuthMiddleware,
active *middleware.ActiveMiddleware,
) *DashboardHandler {
h := &DashboardHandler{usecase: usecase}
g := w.Group("/api/v1/dashboard")
g.Use(auth.Auth())
g.Use(auth.Auth(), active.Active("admin"))
g.GET("/statistics", web.BaseHandler(h.Statistics))
g.GET("/category-stat", web.BindHandler(h.CategoryStat))
g.GET("/time-stat", web.BindHandler(h.TimeStat))