37 lines
980 B
C#
37 lines
980 B
C#
using IM.Commons;
|
|
using IM.Protocols.Grpc.Conversation;
|
|
|
|
namespace ConnectorService.Services
|
|
{
|
|
public class ConversationIntegrationService : IConversationIntergrationService
|
|
{
|
|
private readonly ConversationInternal.ConversationInternalClient client;
|
|
|
|
public ConversationIntegrationService(ConversationInternal.ConversationInternalClient client)
|
|
{
|
|
this.client = client;
|
|
}
|
|
|
|
public async Task<List<string>> GetUserStreamKeysAsync(Guid userId)
|
|
{
|
|
var req = new GetUserStreamKeysRequest()
|
|
{
|
|
UserId = userId.ToString()
|
|
};
|
|
var res = await client.GetUserStreamKeysAsync(req);
|
|
if(res == null)
|
|
{
|
|
return [];
|
|
}
|
|
|
|
var list = new List<string>();
|
|
foreach(var item in res.StreamKeys)
|
|
{
|
|
list.Add(item);
|
|
}
|
|
|
|
return list;
|
|
}
|
|
}
|
|
}
|