feat: ver3 branch

Signed-off-by: kubbot & kubecub <3293172751ysy@gmail.com>
This commit is contained in:
kubbot & kubecub
2023-06-30 23:04:28 +08:00
parent 74de8825f6
commit 64bb62d814
105 changed files with 1221 additions and 1845 deletions
+4 -6
View File
@@ -2,6 +2,7 @@ package a2r
import (
"context"
"github.com/OpenIMSDK/Open-IM-Server/pkg/checker"
"github.com/OpenIMSDK/Open-IM-Server/pkg/apiresp"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/log"
@@ -21,12 +22,9 @@ func Call[A, B, C any](
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)
apiresp.GinError(c, errs.ErrArgs.Wrap(err.Error())) // 参数校验失败
return
}
if err := checker.Validate(&req); err != nil {
apiresp.GinError(c, errs.ErrArgs.Wrap(err.Error())) // 参数校验失败
return
}
data, err := rpc(client, c, &req)
if err != nil {