1234567891011121314151617181920212223242526 |
- package init_serve
- import (
- _ "eta_gn/eta_bridge/docs"
- "eta_gn/eta_bridge/global"
- "eta_gn/eta_bridge/middleware"
- "eta_gn/eta_bridge/routers"
- "github.com/gin-gonic/gin"
- )
- // InitRouter 初始化路由
- func InitRouter() (r *gin.Engine) {
- gin.SetMode(global.CONFIG.Serve.RunMode)
- r = gin.Default()
- r.Use(middleware.Cors())
- r.Use(middleware.Recover())
- rBase := r.Group("api/")
- routers.InitAuth(rBase)
- routers.InitEtaTrial(rBase)
- routers.InitIndexData(rBase)
- routers.InitXiangyu(rBase)
- routers.InitPCSG(rBase)
- return
- }
|