From c331d6f200afb754804f8ce6722582c9a398d1b1 Mon Sep 17 00:00:00 2001 From: withchao <993506633@qq.com> Date: Thu, 16 Mar 2023 18:54:01 +0800 Subject: [PATCH] code error --- internal/api/a2r/api2rpc.go | 4 ++-- internal/api/route.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/api/a2r/api2rpc.go b/internal/api/a2r/api2rpc.go index 693520b84..708088898 100644 --- a/internal/api/a2r/api2rpc.go +++ b/internal/api/a2r/api2rpc.go @@ -17,12 +17,12 @@ func Call[A, B, C any]( var req A if err := c.BindJSON(&req); err != nil { log.ZWarn(c, "gin bind json error", err, "req", req) - apiresp.GinError(c, errs.ErrArgs.Wrap(err.Error())) // 参数错误 + apiresp.GinError(c, errs.ErrArgs.WithDetail(err.Error()).Wrap()) // 参数错误 return } if check, ok := any(&req).(interface{ Check() error }); ok { if err := check.Check(); err != nil { - log.ZWarn(c, "custom check error", err, "req", req) + log.ZWarn(c, "custom check error", err, "req", req) apiresp.GinError(c, errs.ErrArgs.Wrap(err.Error())) // 参数校验失败 return } diff --git a/internal/api/route.go b/internal/api/route.go index 488f98f79..a8697a8fc 100644 --- a/internal/api/route.go +++ b/internal/api/route.go @@ -41,7 +41,7 @@ func NewGinRouter(zk discoveryregistry.SvcDiscoveryRegistry, rdb redis.Universal userRouterGroupChildToken.POST("/account_check", u.AccountCheck) // todo userRouterGroupChildToken.POST("/get_users", u.GetUsers) } - ////friend routing group + //friend routing group friendRouterGroup := r.Group("/friend") { f := NewFriend(zk)