diff --git a/internal/api/a2r/api2rpc.go b/internal/api/a2r/api2rpc.go index 33f69f7ac..56acd6908 100644 --- a/internal/api/a2r/api2rpc.go +++ b/internal/api/a2r/api2rpc.go @@ -2,6 +2,7 @@ package a2r import ( "OpenIM/internal/apiresp" + "OpenIM/pkg/common/log" "OpenIM/pkg/errs" "context" "github.com/gin-gonic/gin" @@ -15,11 +16,13 @@ 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) apiresp.GinError(c, errs.ErrArgs.Wrap(err.Error())) // 参数错误 return } if check, ok := any(&req).(interface{ Check() error }); ok { if err := check.Check(); err != nil { + log.ZWarn(c, "custom check error", err, req) apiresp.GinError(c, errs.ErrArgs.Wrap(err.Error())) // 参数校验失败 return }