using TakeoutSaaS.Application.Messaging.Abstractions;
using TakeoutSaaS.Module.Messaging.Abstractions;

namespace TakeoutSaaS.Application.Messaging.Services;

/// <summary>
/// 事件发布适配器，封装应用层到 MQ 的发布。
/// </summary>
public sealed class EventPublisher(IMessagePublisher messagePublisher) : IEventPublisher
{
    /// <inheritdoc />
    public Task PublishAsync<TEvent>(string routingKey, TEvent @event, CancellationToken cancellationToken = default)
        => messagePublisher.PublishAsync(routingKey, @event, cancellationToken);
}
