router.go 560 B

1234567891011121314151617181920212223242526
  1. package init_serve
  2. import (
  3. "github.com/gin-gonic/gin"
  4. _ "hongze/hz_crm_eta/docs"
  5. "hongze/hz_crm_eta/global"
  6. "hongze/hz_crm_eta/middleware"
  7. "hongze/hz_crm_eta/routers"
  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.InitChartPermission(rBase)
  19. routers.InitReportChapterType(rBase)
  20. routers.InitReportClassify(rBase)
  21. return
  22. }