Commit fc8c061a by zhengqiuyun86

初始化

parent 24152d41
......@@ -14,4 +14,6 @@ require (
require (
github.com/onsi/ginkgo v1.16.5 // indirect
github.com/onsi/gomega v1.20.0 // indirect
github.com/swaggo/files v0.0.0-20220728132757-551d4a08d97a
github.com/swaggo/gin-swagger v1.5.2
)
......@@ -8,6 +8,8 @@ import (
"git.168cad.top/zhengqiuyun/rym-util/util"
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin/render"
"github.com/swaggo/files"
"github.com/swaggo/gin-swagger"
"net/http"
)
......@@ -20,6 +22,11 @@ func InitGinEngine() *gin.Engine {
})
//自定义验证器
validator.RegisterValidate()
if conf.Env == "dev" || conf.Env == "test" {
//swagger
c.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
log.Info("swagger init success")
}
return c
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment