initrouter增加group壳子 方便统一添加前缀 多服务部署使用 添加前缀过后 请统一处理api数据库

This commit is contained in:
pixel
2019-12-13 16:37:53 +08:00
parent 99f20f465d
commit 90b9001430
9 changed files with 33 additions and 38 deletions

View File

@@ -15,14 +15,15 @@ func InitRouter() *gin.Engine {
//Router.Use(middleware.LoadTls()) // 打开就能玩https了
Router.Use(middleware.Logger()) // 如果不需要日志 请关闭这里
Router.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
ApiGroup := Router.Group("") // 方便统一添加路由组前缀 多服务器上线使用
//Router.Use(middleware.Logger())
router.InitUserRouter(Router) // 注册用户路由
router.InitBaseRouter(Router) // 注册基础功能路由 不做鉴权
router.InitMenuRouter(Router) // 注册menu路由
router.InitAuthorityRouter(Router) // 注册角色路由
router.InitApiRouter(Router) // 注册功能api路由
router.InitFileUploadAndDownloadRouter(Router) // 文件上传下载功能路由
router.InitWorkflowRouter(Router) // 工作流相关路由
router.InitCasbinRouter(Router)
router.InitUserRouter(ApiGroup) // 注册用户路由
router.InitBaseRouter(ApiGroup) // 注册基础功能路由 不做鉴权
router.InitMenuRouter(ApiGroup) // 注册menu路由
router.InitAuthorityRouter(ApiGroup) // 注册角色路由
router.InitApiRouter(ApiGroup) // 注册功能api路由
router.InitFileUploadAndDownloadRouter(ApiGroup) // 文件上传下载功能路由
router.InitWorkflowRouter(ApiGroup) // 工作流相关路由
router.InitCasbinRouter(ApiGroup)
return Router
}