init
This commit is contained in:
commit
ab2e20f7e1
72 changed files with 2000 additions and 0 deletions
|
@ -0,0 +1,19 @@
|
|||
using Femto.Modules.Blog.Contracts.Events;
|
||||
using Femto.Modules.Blog.Domain.Posts.Events;
|
||||
using Femto.Modules.Blog.Infrastructure.Integration;
|
||||
using MediatR;
|
||||
|
||||
namespace Femto.Modules.Blog.Domain.Posts.Handlers;
|
||||
|
||||
internal class PostCreatedHandler(Outbox outbox) : INotificationHandler<PostCreated>
|
||||
{
|
||||
public async Task Handle(PostCreated notification, CancellationToken cancellationToken)
|
||||
{
|
||||
var post = notification.Post;
|
||||
await outbox.AddMessage(
|
||||
post.Id,
|
||||
new PostCreatedIntegrationEvent(Guid.CreateVersion7(), post.Id, post.Media.Select(m => m.Id)),
|
||||
cancellationToken
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue