All checks were successful
Server Check Build (NixCN CMS) TeamCity build finished
Signed-off-by: Asai Neko <sugar@sne.moe>
23 lines
443 B
Go
23 lines
443 B
Go
package stats
|
|
|
|
import (
|
|
"nixcn-cms/middleware"
|
|
"nixcn-cms/service/service_stats"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
type StatsHandler struct {
|
|
svc service_stats.StatsService
|
|
}
|
|
|
|
func ApiHandler(r *gin.RouterGroup) {
|
|
statsSvc := service_stats.NewStatsService()
|
|
statsHandler := &StatsHandler{statsSvc}
|
|
|
|
// Lv40+ routes
|
|
lv40 := r.Group("")
|
|
lv40.Use(middleware.JWTAuth(), middleware.Permission(40))
|
|
lv40.GET("/global", statsHandler.Global)
|
|
}
|