|
@ -5,12 +5,14 @@ import ( |
|
|
"github.com/swaggo/gin-swagger" |
|
|
"github.com/swaggo/gin-swagger" |
|
|
"github.com/swaggo/gin-swagger/swaggerFiles" |
|
|
"github.com/swaggo/gin-swagger/swaggerFiles" |
|
|
_ "main/docs" |
|
|
_ "main/docs" |
|
|
|
|
|
"main/middleware" |
|
|
"main/router" |
|
|
"main/router" |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
//初始化总路由
|
|
|
//初始化总路由
|
|
|
func InitRouter() *gin.Engine { |
|
|
func InitRouter() *gin.Engine { |
|
|
var Router = gin.Default() |
|
|
var Router = gin.Default() |
|
|
|
|
|
Router.Use(middleware.Logger()) // 如果不需要日志 请关闭这里
|
|
|
Router.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler)) |
|
|
Router.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler)) |
|
|
//Router.Use(middleware.Logger())
|
|
|
//Router.Use(middleware.Logger())
|
|
|
router.InitUserRouter(Router) // 注册用户路由
|
|
|
router.InitUserRouter(Router) // 注册用户路由
|
|
|