➕ add swagger
This commit is contained in:
@@ -2,12 +2,12 @@ package modules
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"schisandra-cloud-album/common/result"
|
||||
"schisandra-cloud-album/api"
|
||||
)
|
||||
|
||||
var authApi = api.Api.AuthApi
|
||||
|
||||
func AuthRouter(router *gin.RouterGroup) {
|
||||
group := router.Group("auth")
|
||||
group.GET("/user", func(c *gin.Context) {
|
||||
result.FailWithCode(result.SystemError, c)
|
||||
})
|
||||
group.GET("/user/List", authApi.GetUserList)
|
||||
}
|
||||
|
13
router/modules/swagger_router.go
Normal file
13
router/modules/swagger_router.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package modules
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
swaggerFiles "github.com/swaggo/files"
|
||||
ginSwagger "github.com/swaggo/gin-swagger"
|
||||
"schisandra-cloud-album/docs"
|
||||
)
|
||||
|
||||
func SwaggerRouter(router *gin.Engine) {
|
||||
docs.SwaggerInfo.BasePath = ""
|
||||
router.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
|
||||
}
|
Reference in New Issue
Block a user