From 5b4cc786ed62888b07c62177d2c7191a9b60f222 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Wed, 15 Mar 2023 14:50:23 +0800 Subject: [PATCH] log update --- internal/api/a2r/api2rpc.go | 3 +++ 1 file changed, 3 insertions(+) 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 }