19 lines
599 B
C#
19 lines
599 B
C#
using GroupService.Domain.Events;
|
|
using IM.Commons.IntegrationEvents;
|
|
using MassTransit;
|
|
using MediatR;
|
|
|
|
namespace GroupService.WebApi.Application.EventHandler
|
|
{
|
|
public class GroupMemberLeftHandler(IPublishEndpoint endpoint)
|
|
: INotificationHandler<GroupMemberLeftDomainEvent>
|
|
{
|
|
public Task Handle(GroupMemberLeftDomainEvent notification, CancellationToken cancellationToken)
|
|
{
|
|
return endpoint.Publish(
|
|
new GroupMemberLeftEvent(notification.Member.UserId, notification.Member.GroupId),
|
|
cancellationToken);
|
|
}
|
|
}
|
|
}
|