Files
wx_service/internal/routes/admin_routes.go
T

30 lines
659 B
Go

package routes
import (
"github.com/gin-gonic/gin"
adminhandler "wx_service/internal/admin"
)
func registerAdminRoutes(router *gin.Engine, handler *adminhandler.Handler) {
if handler == nil {
return
}
admin := router.Group("/api/admin")
{
admin.POST("/login", handler.Login)
protected := admin.Group("")
protected.Use(handler.AuthMiddleware())
{
protected.GET("/profile", handler.Profile)
protected.POST("/logout", handler.Logout)
protected.GET("/stats/overview", handler.StatsOverview)
protected.GET("/stats/mini-programs", handler.StatsMiniPrograms)
protected.GET("/stats/user-growth", handler.StatsUserGrowth)
}
}
}