You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
674 B

5 years ago
  1. package initRouter
  2. import (
  3. "github.com/gin-gonic/gin"
  4. "github.com/swaggo/gin-swagger"
  5. "github.com/swaggo/gin-swagger/swaggerFiles"
  6. _ "main/docs"
  7. "main/router"
  8. )
  9. //初始化总路由
  10. func InitRouter() *gin.Engine {
  11. var Router = gin.Default()
  12. Router.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
  13. //Router.Use(middleware.Logger())
  14. router.InitUserRouter(Router) // 注册用户路由
  15. router.InitBaseRouter(Router) // 注册基础功能路由
  16. router.InitMenuRouter(Router) // 注册menu路由
  17. router.InitAuthorityRouter(Router) // 注册角色路由
  18. router.InitApiRouter(Router) // 注册功能api路由
  19. return Router
  20. }