[FA-misc] Mass transit overhaul, needs testing and review
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
using FictionArchive.Service.Shared.MassTransit.Contracts.Commands;
|
||||
using MassTransit;
|
||||
|
||||
namespace FictionArchive.Service.NovelService.Services.Consumers;
|
||||
|
||||
public class PullChapterContentCommandConsumer : IConsumer<PullChapterContentCommand>
|
||||
{
|
||||
private readonly ILogger<PullChapterContentCommandConsumer> _logger;
|
||||
private readonly NovelUpdateService _novelUpdateService;
|
||||
|
||||
public PullChapterContentCommandConsumer(
|
||||
ILogger<PullChapterContentCommandConsumer> logger,
|
||||
NovelUpdateService novelUpdateService)
|
||||
{
|
||||
_logger = logger;
|
||||
_novelUpdateService = novelUpdateService;
|
||||
}
|
||||
|
||||
public async Task Consume(ConsumeContext<PullChapterContentCommand> context)
|
||||
{
|
||||
var command = context.Message;
|
||||
_logger.LogInformation(
|
||||
"Processing PullChapterContentCommand for Novel: {NovelId}, Volume: {VolumeId}, Chapter: {ChapterOrder}",
|
||||
command.NovelId, command.VolumeId, command.ChapterOrder);
|
||||
|
||||
await _novelUpdateService.PullChapterContents(command.NovelId, command.VolumeId, command.ChapterOrder);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user