router.go 548 B

123456789101112131415161718192021222324252627
  1. package init_serve
  2. import (
  3. _ "eta/eta_bridge/docs"
  4. "eta/eta_bridge/global"
  5. "eta/eta_bridge/middleware"
  6. "eta/eta_bridge/routers"
  7. "github.com/gin-gonic/gin"
  8. )
  9. // InitRouter 初始化路由
  10. func InitRouter() (r *gin.Engine) {
  11. gin.SetMode(global.CONFIG.Serve.RunMode)
  12. r = gin.Default()
  13. r.Use(middleware.Cors())
  14. r.Use(middleware.Recover())
  15. rBase := r.Group("api/")
  16. routers.InitAuth(rBase)
  17. routers.InitEtaTrial(rBase)
  18. routers.InitIndexData(rBase)
  19. routers.InitXiangyu(rBase)
  20. routers.InitPCSG(rBase)
  21. routers.InitHTSSO(rBase)
  22. return
  23. }