mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
log update
This commit is contained in:
parent
a40ad5df68
commit
5b4cc786ed
@ -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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user