feat: finalize core modules and gateway
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
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);
|
||||
}
|
||||
Reference in New Issue
Block a user