123456789101112131415161718192021222324 |
- package init_serve
- import (
- _ "eta/eta_docs/docs"
- "eta/eta_docs/global"
- "eta/eta_docs/middleware"
- "eta/eta_docs/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.InitVersionUpdateLog(rBase) // 版本更新日志
- routers.InitHelpDoc(rBase) // 帮助文档
- routers.InitEtaTrainingVideo(rBase) // 培训视频
- return
- }
|