添加项目文件。

This commit is contained in:
2026-05-09 17:06:30 +08:00
parent c60f5fe117
commit 720ef957d4
378 changed files with 14843 additions and 0 deletions
@@ -0,0 +1,32 @@
using ContactService.Domain.Events;
using IM.Commons.IntegrationEvents;
using MassTransit;
using MediatR;
namespace ContactService.WebApi.Application.EventHandler
{
public class FriendAddedHandler : INotificationHandler<FriendAddedDomainEvent>
{
private readonly IPublishEndpoint endpoint;
public FriendAddedHandler(IPublishEndpoint endpoint)
{
this.endpoint = endpoint;
}
public async Task Handle(FriendAddedDomainEvent notification, CancellationToken cancellationToken)
{
await endpoint.Publish(new FriendAddedEvent
{
OwnerAvatar = notification.Friend.Owner.Avatar,
OwnerId = notification.Friend.Owner.Id,
OwnerNickName = notification.Friend.Owner.NickName,
TargetAvatar = notification.Friend.Target.Avatar,
TargetId = notification.Friend.Target.Id,
TargetNickName = notification.Friend.Target.NickName,
RemarkName = notification.Friend.RemarkName,
Status = notification.Friend.Status.ToString(),
}, cancellationToken);
}
}
}