init
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
using DouyinApi.Common;
|
||||
using DouyinApi.EventBus.EventHandling;
|
||||
using DouyinApi.IServices;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DouyinApi.EventBus
|
||||
{
|
||||
public class BlogQueryIntegrationEventHandler : IIntegrationEventHandler<BlogQueryIntegrationEvent>
|
||||
{
|
||||
private readonly IBlogArticleServices _blogArticleServices;
|
||||
private readonly ILogger<BlogQueryIntegrationEventHandler> _logger;
|
||||
|
||||
public BlogQueryIntegrationEventHandler(
|
||||
IBlogArticleServices blogArticleServices,
|
||||
ILogger<BlogQueryIntegrationEventHandler> logger)
|
||||
{
|
||||
_blogArticleServices = blogArticleServices;
|
||||
_logger = logger ?? throw new ArgumentNullException(nameof(logger));
|
||||
}
|
||||
|
||||
public async Task Handle(BlogQueryIntegrationEvent @event)
|
||||
{
|
||||
_logger.LogInformation("----- Handling integration event: {IntegrationEventId} at {AppName} - ({@IntegrationEvent})", @event.Id, "DouyinApi", @event);
|
||||
|
||||
ConsoleHelper.WriteSuccessLine($"----- Handling integration event: {@event.Id} at DouyinApi - ({@event})");
|
||||
|
||||
await _blogArticleServices.QueryById(@event.BlogId.ToString());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user