router.go 534 B

1234567891011121314151617181920212223242526
  1. package init_serve
  2. import (
  3. _ "eta_gn/eta_bridge/docs"
  4. "eta_gn/eta_bridge/global"
  5. "eta_gn/eta_bridge/middleware"
  6. "eta_gn/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. return
  22. }