28 lines
789 B
C#
28 lines
789 B
C#
|
|
using IM.Commons;
|
|
using IM.Protocols.Grpc.Contact;
|
|
|
|
namespace MessageService.WebApi.Application.IntegrationServices
|
|
{
|
|
public class ContactIntegrationService : IContactIntegrationService
|
|
{
|
|
private readonly ContactInternal.ContactInternalClient client;
|
|
|
|
public ContactIntegrationService(ContactInternal.ContactInternalClient client)
|
|
{
|
|
this.client = client;
|
|
}
|
|
|
|
public async Task<bool> CheckContactAsync(Guid ownerId, Guid targetId)
|
|
{
|
|
var req = new CheckFriendshipRequest()
|
|
{
|
|
OwnerId = ownerId.ToString(),
|
|
TargetId = targetId.ToString(),
|
|
};
|
|
var res = await client.CheckFriendshipAsync(req);
|
|
return res.Checked;
|
|
}
|
|
}
|
|
}
|