router.go 472 B

1234567891011121314151617181920212223
  1. package init_serve
  2. import (
  3. _ "eta/eta_email_analysis/docs"
  4. "eta/eta_email_analysis/global"
  5. "eta/eta_email_analysis/middleware"
  6. "eta/eta_email_analysis/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.InitXiangyu(rBase)
  18. return
  19. }