mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-26 03:26:57 +08:00
code error
This commit is contained in:
parent
5c38ffa15e
commit
c331d6f200
@ -17,12 +17,12 @@ func Call[A, B, C any](
|
|||||||
var req A
|
var req A
|
||||||
if err := c.BindJSON(&req); err != nil {
|
if err := c.BindJSON(&req); err != nil {
|
||||||
log.ZWarn(c, "gin bind json error", err, "req", req)
|
log.ZWarn(c, "gin bind json error", err, "req", req)
|
||||||
apiresp.GinError(c, errs.ErrArgs.Wrap(err.Error())) // 参数错误
|
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).(interface{ Check() error }); 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())) // 参数校验失败
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ func NewGinRouter(zk discoveryregistry.SvcDiscoveryRegistry, rdb redis.Universal
|
|||||||
userRouterGroupChildToken.POST("/account_check", u.AccountCheck) // todo
|
userRouterGroupChildToken.POST("/account_check", u.AccountCheck) // todo
|
||||||
userRouterGroupChildToken.POST("/get_users", u.GetUsers)
|
userRouterGroupChildToken.POST("/get_users", u.GetUsers)
|
||||||
}
|
}
|
||||||
////friend routing group
|
//friend routing group
|
||||||
friendRouterGroup := r.Group("/friend")
|
friendRouterGroup := r.Group("/friend")
|
||||||
{
|
{
|
||||||
f := NewFriend(zk)
|
f := NewFriend(zk)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user