Realm and chat with status listing member API

This commit is contained in:
2025-08-17 23:32:58 +08:00
parent aa9ae5c11e
commit b49cd1c382
10 changed files with 172 additions and 81 deletions

View File

@@ -1,3 +1,4 @@
using DysonNetwork.Shared.Data;
using DysonNetwork.Shared.Proto;
namespace DysonNetwork.Shared.Registry;
@@ -10,7 +11,7 @@ public class AccountClientHelper(AccountService.AccountServiceClient accounts)
var response = await accounts.GetAccountAsync(request);
return response;
}
public async Task<List<Account>> GetAccountBatch(List<Guid> ids)
{
var request = new GetAccountBatchRequest();
@@ -18,4 +19,14 @@ public class AccountClientHelper(AccountService.AccountServiceClient accounts)
var response = await accounts.GetAccountBatchAsync(request);
return response.Accounts.ToList();
}
public async Task<Dictionary<Guid, AccountStatusReference>> GetAccountStatusBatch(List<Guid> ids)
{
var request = new GetAccountBatchRequest();
request.Id.AddRange(ids.Select(id => id.ToString()));
var response = await accounts.GetAccountStatusBatchAsync(request);
return response.Statuses
.Select(AccountStatusReference.FromProtoValue)
.ToDictionary(s => s.AccountId, s => s);
}
}