Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
withchao committed Jul 6, 2023
1 parent 5fd1bc1 commit c204867
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/rpc/admin/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ package admin

import (
"context"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/log"
"github.com/OpenIMSDK/chat/pkg/common/constant"
"strings"
"time"

Expand Down Expand Up @@ -99,6 +101,7 @@ func (o *adminServer) SearchBlockUser(ctx context.Context, req *admin.SearchBloc
if _, err := mctx.CheckAdmin(ctx); err != nil {
return nil, err
}
log.ZInfo(ctx, "SearchBlockUser", "RpcOpUserID", ctx.Value(constant.RpcOpUserID), "RpcOpUserType", ctx.Value(constant.RpcOpUserType))
total, infos, err := o.Database.SearchBlockUser(ctx, req.Keyword, req.Pagination.PageNumber, req.Pagination.ShowNumber)
if err != nil {
return nil, err
Expand Down
1 change: 1 addition & 0 deletions pkg/common/mw/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (

func AddUserType() grpc.DialOption {
return grpc.WithUnaryInterceptor(func(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error {
log.ZInfo(ctx, "add user type", "method", method)
if arr, _ := ctx.Value(constant.RpcOpUserType).([]string); len(arr) > 0 {
userType, err := strconv.Atoi(arr[0])
if err != nil {
Expand Down

0 comments on commit c204867

Please sign in to comment.