feat: 完成后台Issue#4 管理员认证接口模块

This commit is contained in:
root
2026-03-09 19:25:44 +08:00
parent 172a543a5e
commit 54cf7ea37f
13 changed files with 466 additions and 3 deletions
+25
View File
@@ -0,0 +1,25 @@
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)
}
}
}