1234567891011121314151617181920 |
- package swagger
- import (
- "Cold_Logistic/docs"
- "github.com/gin-gonic/gin"
- swaggerFiles "github.com/swaggo/files"
- ginSwagger "github.com/swaggo/gin-swagger"
- )
- // RegisterSwagger 注册Swagger
- func RegisterSwagger(r *gin.Engine) {
- // API文档访问地址: http://host/swagger/index.html
- // 注解定义可参考 https://github.com/swaggo/swag#declarative-comments-format
- docs.SwaggerInfo.BasePath = "/clodLogistic/api/v1"
- docs.SwaggerInfo.Title = "冷链运输平台接口文档"
- docs.SwaggerInfo.Version = "1.0"
- docs.SwaggerInfo.Host = "localhost:8888"
- docs.SwaggerInfo.Schemes = []string{"http", "https"}
- r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
- }
|