diff --git a/app/mw/mw_limiter.go b/app/mw/mw_limiter.go index 499e4c6..0aa78e1 100644 --- a/app/mw/mw_limiter.go +++ b/app/mw/mw_limiter.go @@ -27,7 +27,7 @@ func Limiter(c *gin.Context) { host := c.Request.Host uri := c.Request.URL.String() - buf := make([]byte, 5120*100) + buf := make([]byte, 1024*1024) num, _ := c.Request.Body.Read(buf) body := buf[:num] diff --git a/app/router/router.go b/app/router/router.go index ed99187..076a733 100644 --- a/app/router/router.go +++ b/app/router/router.go @@ -7,6 +7,7 @@ import ( "applet/app/hdl/friend_circle" "applet/app/mw" _ "applet/docs" + "github.com/gin-contrib/pprof" "github.com/gin-gonic/gin" swaggerFiles "github.com/swaggo/files" ginSwagger "github.com/swaggo/gin-swagger" @@ -46,6 +47,7 @@ func Init() *gin.Engine { }) r.Use(mw.Cors) route(r.Group("/api/v1")) + pprof.Register(r, "/api/v1/comm/debug/pprof") return r } diff --git a/go.mod b/go.mod index d8e6ea4..feddd75 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,8 @@ module applet -go 1.19 +go 1.21.0 + +toolchain go1.23.2 // replace code.fnuoos.com/EggPlanet/egg_models.git => E:/company/Egg/egg_models @@ -10,10 +12,10 @@ require ( github.com/boombuler/barcode v1.0.1 github.com/dchest/uniuri v0.0.0-20200228104902-7aecb25e1fe5 github.com/dgrijalva/jwt-go v3.2.0+incompatible - github.com/gin-gonic/gin v1.9.1 + github.com/gin-gonic/gin v1.10.0 github.com/go-playground/locales v0.14.1 github.com/go-playground/universal-translator v0.18.1 - github.com/go-playground/validator/v10 v10.20.0 + github.com/go-playground/validator/v10 v10.22.1 github.com/go-redis/redis v6.15.9+incompatible github.com/gomodule/redigo v2.0.0+incompatible github.com/jinzhu/copier v0.4.0 @@ -37,6 +39,7 @@ require ( code.fnuoos.com/go_rely_warehouse/zyos_go_es.git v1.0.1-0.20241118083738-0f22da9ba0be code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git v0.0.5 github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible + github.com/gin-contrib/pprof v1.5.1 github.com/gin-contrib/sessions v1.0.1 github.com/go-pay/crypto v0.0.1 github.com/go-pay/gopay v1.5.101 @@ -49,7 +52,7 @@ require ( github.com/shopspring/decimal v1.3.1 github.com/tidwall/gjson v1.18.0 google.golang.org/grpc v1.32.0 - google.golang.org/protobuf v1.34.0 + google.golang.org/protobuf v1.35.2 ) require ( @@ -72,20 +75,20 @@ require ( github.com/antchfx/htmlquery v1.3.3 // indirect github.com/antchfx/xmlquery v1.4.2 // indirect github.com/antchfx/xpath v1.3.2 // indirect - github.com/bytedance/sonic v1.11.6 // indirect - github.com/bytedance/sonic/loader v0.1.1 // indirect + github.com/bytedance/sonic v1.12.4 // indirect + github.com/bytedance/sonic/loader v0.2.1 // indirect github.com/clbanning/mxj/v2 v2.5.5 // indirect github.com/cloudwego/base64x v0.1.4 // indirect github.com/cloudwego/iasm v0.2.0 // indirect github.com/fsnotify/fsnotify v1.4.9 // indirect - github.com/gabriel-vasile/mimetype v1.4.3 // indirect + github.com/gabriel-vasile/mimetype v1.4.6 // indirect github.com/gin-contrib/sse v0.1.0 // indirect github.com/go-openapi/jsonpointer v0.19.5 // indirect github.com/go-openapi/jsonreference v0.20.0 // indirect github.com/go-openapi/spec v0.20.11 // indirect github.com/go-openapi/swag v0.19.15 // indirect github.com/gobwas/glob v0.2.3 // indirect - github.com/goccy/go-json v0.10.2 // indirect + github.com/goccy/go-json v0.10.3 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/golang/snappy v0.0.4 // indirect @@ -96,13 +99,13 @@ require ( github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/kennygrant/sanitize v1.2.4 // indirect - github.com/klauspost/cpuid/v2 v2.2.7 // indirect + github.com/klauspost/cpuid/v2 v2.2.9 // indirect github.com/leodido/go-urn v1.4.0 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/pelletier/go-toml/v2 v2.2.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.3 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d // indirect github.com/streadway/amqp v1.0.0 // indirect @@ -115,13 +118,13 @@ require ( github.com/ugorji/go/codec v1.2.12 // indirect go.uber.org/atomic v1.7.0 // indirect go.uber.org/multierr v1.6.0 // indirect - golang.org/x/arch v0.7.0 // indirect - golang.org/x/crypto v0.23.0 // indirect + golang.org/x/arch v0.12.0 // indirect + golang.org/x/crypto v0.29.0 // indirect golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect - golang.org/x/net v0.25.0 // indirect - golang.org/x/sync v0.8.0 // indirect - golang.org/x/sys v0.26.0 // indirect - golang.org/x/text v0.18.0 // indirect + golang.org/x/net v0.31.0 // indirect + golang.org/x/sync v0.9.0 // indirect + golang.org/x/sys v0.27.0 // indirect + golang.org/x/text v0.20.0 // indirect golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect