Files
IM_NEW/MessageService.WebApi/Application/IntegrationServices/ContactIntegrationService.cs
2026-05-09 17:06:30 +08:00

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;
}
}
}