mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-06 10:05:58 +08:00
db
This commit is contained in:
@@ -1,16 +1,12 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"OpenIM/pkg/common/constant"
|
||||
"OpenIM/pkg/common/db/table/relation"
|
||||
"OpenIM/pkg/common/db/tx"
|
||||
"OpenIM/pkg/errs"
|
||||
"OpenIM/pkg/utils"
|
||||
"context"
|
||||
"errors"
|
||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/constant"
|
||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/tx"
|
||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/tracelog"
|
||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/errs"
|
||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/utils"
|
||||
"gorm.io/gorm"
|
||||
|
||||
@@ -48,10 +48,10 @@ func rpcServerInterceptor(ctx context.Context, req interface{}, info *grpc.Unary
|
||||
}
|
||||
ctx = context.WithValue(ctx, OperationID, operationID)
|
||||
ctx = context.WithValue(ctx, OpUserID, opUserID)
|
||||
log.ZInfo(ctx, "rpc req", "funcName", funcName, "req", rpcString(req))
|
||||
log.ZInfo(ctx, "rpc server req", "funcName", funcName, "req", rpcString(req))
|
||||
resp, err = handler(ctx, req)
|
||||
if err == nil {
|
||||
log.ZInfo(ctx, "rpc resp", "funcName", funcName, "resp", rpcString(resp))
|
||||
log.ZInfo(ctx, "rpc server resp", "funcName", funcName, "resp", rpcString(resp))
|
||||
return resp, nil
|
||||
}
|
||||
unwrap := errs.Unwrap(err)
|
||||
@@ -72,7 +72,7 @@ func rpcServerInterceptor(ctx context.Context, req interface{}, info *grpc.Unary
|
||||
grpcStatus = details
|
||||
}
|
||||
}
|
||||
log.ZWarn(ctx, "rpc resp", err, "funcName", funcName)
|
||||
log.ZError(ctx, "rpc server resp", err, "funcName", funcName)
|
||||
return nil, grpcStatus.Err()
|
||||
}
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ func CheckAdmin(ctx context.Context) error {
|
||||
if utils.IsContain(tracelog.GetOpUserID(ctx), config.Config.Manager.AppManagerUid) {
|
||||
return nil
|
||||
}
|
||||
return errs.ErrIdentity.Wrap()
|
||||
return errs.ErrIdentity.Wrap("is not admin")
|
||||
}
|
||||
|
||||
func ParseRedisInterfaceToken(redisToken interface{}) (*Claims, error) {
|
||||
|
||||
Reference in New Issue
Block a user