1.0
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package routers
|
||||
|
||||
import (
|
||||
"awesomeProject/internal/middleware"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// SetupRouter 设置路由
|
||||
func SetupRouter() *gin.Engine {
|
||||
// 创建gin引擎
|
||||
router := gin.Default()
|
||||
|
||||
// 添加全局中间件
|
||||
router.Use(middleware.CORSMiddleware())
|
||||
|
||||
// 设置公共路由(如登录、注册等)
|
||||
SetupPublicRoutes(router)
|
||||
|
||||
// 设置管理端路由
|
||||
SetupAdminRoutes(router)
|
||||
|
||||
// 设置用户端路由
|
||||
SetupUserRoutes(router)
|
||||
|
||||
return router
|
||||
}
|
||||
Reference in New Issue
Block a user