mirror of
https://github.com/Cleanuparr/Cleanuparr.git
synced 2026-10-28 10:48:49 -04:00
18 lines
610 B
C#
18 lines
610 B
C#
using Cleanuparr.Infrastructure.Features.Notifications.Models;
|
|
using MassTransit;
|
|
|
|
namespace Cleanuparr.Infrastructure.Features.Notifications.Consumers;
|
|
|
|
public sealed class NotificationConsumer : IConsumer<NotificationMessage>
|
|
{
|
|
private readonly NotificationService _notificationService;
|
|
|
|
public NotificationConsumer(NotificationService notificationService)
|
|
{
|
|
_notificationService = notificationService;
|
|
}
|
|
|
|
public Task Consume(ConsumeContext<NotificationMessage> context) =>
|
|
_notificationService.SendNotificationAsync(context.Message.EventType, context.Message.Context);
|
|
}
|