mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-03 19:02:31 +08:00
update user command
This commit is contained in:
parent
3c57baec6b
commit
73b8f76185
@ -375,8 +375,8 @@ func (s *userServer) ProcessUserCommandGet(ctx context.Context, req *pbuser.Proc
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create a slice to store CommandInfoResp
|
// Initialize commandInfoSlice as an empty slice
|
||||||
commandInfoSlice := []*pbuser.CommandInfoResp{}
|
commandInfoSlice := make([]*pbuser.CommandInfoResp, 0, len(commands))
|
||||||
|
|
||||||
for _, v := range commands {
|
for _, v := range commands {
|
||||||
commandInfoSlice = append(commandInfoSlice, &pbuser.CommandInfoResp{
|
commandInfoSlice = append(commandInfoSlice, &pbuser.CommandInfoResp{
|
||||||
@ -386,6 +386,6 @@ func (s *userServer) ProcessUserCommandGet(ctx context.Context, req *pbuser.Proc
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return the new slice
|
// Return the response with the slice, which is empty but not nil if there are no commands
|
||||||
return &pbuser.ProcessUserCommandGetResp{KVArray: commandInfoSlice}, nil
|
return &pbuser.ProcessUserCommandGetResp{KVArray: commandInfoSlice}, nil
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user