diff --git a/cmd/sponge/server/http.go b/cmd/sponge/server/http.go index 9047e28..48ae9cb 100644 --- a/cmd/sponge/server/http.go +++ b/cmd/sponge/server/http.go @@ -12,11 +12,9 @@ import ( "time" "github.com/gin-gonic/gin" - "github.com/gin-gonic/gin/binding" "github.com/go-dev-frame/sponge/pkg/gin/handlerfunc" "github.com/go-dev-frame/sponge/pkg/gin/middleware" - "github.com/go-dev-frame/sponge/pkg/gin/validator" "github.com/go-dev-frame/sponge/pkg/logger" ) @@ -36,7 +34,6 @@ func NewRouter(spongeAddr string, isLog bool) *gin.Engine { if isLog { r.Use(middleware.Logging(middleware.WithLog(logger.Get()))) } - binding.Validator = validator.Init() // solve vue using history route 404 problem r.NoRoute(handlerfunc.BrowserRefreshFS(staticFS, "static/index.html")) diff --git a/internal/routers/routers.go b/internal/routers/routers.go index b20e84d..ab68a95 100644 --- a/internal/routers/routers.go +++ b/internal/routers/routers.go @@ -7,7 +7,6 @@ import ( "time" "github.com/gin-gonic/gin" - "github.com/gin-gonic/gin/binding" swaggerFiles "github.com/swaggo/files" ginSwagger "github.com/swaggo/gin-swagger" @@ -16,7 +15,6 @@ import ( "github.com/go-dev-frame/sponge/pkg/gin/middleware" "github.com/go-dev-frame/sponge/pkg/gin/middleware/metrics" "github.com/go-dev-frame/sponge/pkg/gin/prof" - "github.com/go-dev-frame/sponge/pkg/gin/validator" "github.com/go-dev-frame/sponge/pkg/logger" "github.com/go-dev-frame/sponge/docs" @@ -80,9 +78,6 @@ func NewRouter() *gin.Engine { prof.Register(r, prof.WithIOWaitTime()) } - // validator - binding.Validator = validator.Init() - r.GET("/health", handlerfunc.CheckHealth) r.GET("/ping", handlerfunc.Ping) r.GET("/codes", handlerfunc.ListCodes) diff --git a/internal/routers/routers_pbExample.go b/internal/routers/routers_pbExample.go index a50fae0..d0aadc5 100644 --- a/internal/routers/routers_pbExample.go +++ b/internal/routers/routers_pbExample.go @@ -6,7 +6,6 @@ import ( "time" "github.com/gin-gonic/gin" - "github.com/gin-gonic/gin/binding" "github.com/go-dev-frame/sponge/pkg/errcode" "github.com/go-dev-frame/sponge/pkg/gin/handlerfunc" @@ -14,7 +13,6 @@ import ( "github.com/go-dev-frame/sponge/pkg/gin/middleware/metrics" "github.com/go-dev-frame/sponge/pkg/gin/prof" "github.com/go-dev-frame/sponge/pkg/gin/swagger" - "github.com/go-dev-frame/sponge/pkg/gin/validator" "github.com/go-dev-frame/sponge/pkg/logger" "github.com/go-dev-frame/sponge/docs" @@ -84,9 +82,6 @@ func NewRouter_pbExample() *gin.Engine { //nolint prof.Register(r, prof.WithIOWaitTime()) } - // validator - binding.Validator = validator.Init() - r.GET("/health", handlerfunc.CheckHealth) r.GET("/ping", handlerfunc.Ping) r.GET("/codes", handlerfunc.ListCodes)