|
|
@ -2,6 +2,7 @@ package a2r
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"context"
|
|
|
|
|
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/checker"
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/apiresp"
|
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/apiresp"
|
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/log"
|
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/log"
|
|
|
@ -21,7 +22,7 @@ func Call[A, B, C any](
|
|
|
|
apiresp.GinError(c, errs.ErrArgs.WithDetail(err.Error()).Wrap()) // 参数错误
|
|
|
|
apiresp.GinError(c, errs.ErrArgs.WithDetail(err.Error()).Wrap()) // 参数错误
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if check, ok := any(&req).(interface{ Check() error }); ok {
|
|
|
|
if check, ok := any(&req).(checker.Checker); ok {
|
|
|
|
if err := check.Check(); err != nil {
|
|
|
|
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())) // 参数校验失败
|
|
|
|
apiresp.GinError(c, errs.ErrArgs.Wrap(err.Error())) // 参数校验失败
|
|
|
|