添加项目文件。
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
using IdentityService.Domain.Events;
|
||||
using IM.Commons.IntegrationEvents;
|
||||
using MassTransit;
|
||||
using MediatR;
|
||||
|
||||
namespace IdentityService.WebApi.Applications.EventHandler
|
||||
{
|
||||
public class UserProfileUpdateHandler : INotificationHandler<UserProfileUpdateDomainEvent>
|
||||
{
|
||||
private readonly IPublishEndpoint endpoint;
|
||||
|
||||
public UserProfileUpdateHandler(IPublishEndpoint endpoint)
|
||||
{
|
||||
this.endpoint = endpoint;
|
||||
}
|
||||
|
||||
public async Task Handle(UserProfileUpdateDomainEvent notification, CancellationToken cancellationToken)
|
||||
{
|
||||
await endpoint.Publish(new UserProfileUpdateEvent
|
||||
{
|
||||
CorrelationId = notification.User.Id,
|
||||
Avatar = notification.User.Avatar,
|
||||
Description = notification.User.Description,
|
||||
Email = notification.User.Email,
|
||||
NickName = notification.User.NickName,
|
||||
Phone = notification.User.PhoneNumber,
|
||||
Status = notification.User.Status.ToString(),
|
||||
UserId = notification.User.Id
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user