[FA-4] Adds an event bus infrastructure, a RabbitMQ implementation and rewires existing mutations on NovelService to utilize it.
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
using FictionArchive.Service.Shared.Services.EventBus;
|
||||
|
||||
namespace FictionArchive.Service.NovelService.Models.IntegrationEvents;
|
||||
|
||||
public class ChapterPullRequestedEvent : IntegrationEvent
|
||||
{
|
||||
public uint NovelId { get; set; }
|
||||
public uint ChapterNumber { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
using FictionArchive.Service.Shared.Services.EventBus;
|
||||
|
||||
namespace FictionArchive.Service.NovelService.Models.IntegrationEvents;
|
||||
|
||||
public class NovelUpdateRequestedEvent : IntegrationEvent
|
||||
{
|
||||
public string NovelUrl { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using FictionArchive.Common.Enums;
|
||||
using FictionArchive.Service.Shared.Services.EventBus;
|
||||
|
||||
namespace FictionArchive.Service.NovelService.Models.IntegrationEvents;
|
||||
|
||||
public class TranslationRequestCompletedEvent : IntegrationEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Maps this event back to a triggering request.
|
||||
/// </summary>
|
||||
public Guid? TranslationRequestId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The resulting text.
|
||||
/// </summary>
|
||||
public string? TranslatedText { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using FictionArchive.Common.Enums;
|
||||
using FictionArchive.Service.Shared.Services.EventBus;
|
||||
|
||||
namespace FictionArchive.Service.NovelService.Models.IntegrationEvents;
|
||||
|
||||
public class TranslationRequestCreatedEvent : IntegrationEvent
|
||||
{
|
||||
public Guid TranslationRequestId { get; set; }
|
||||
public Language From { get; set; }
|
||||
public Language To { get; set; }
|
||||
public string Body { get; set; }
|
||||
public string TranslationEngineKey { get; set; }
|
||||
}
|
||||
@@ -5,7 +5,7 @@ using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace FictionArchive.Service.NovelService.Models.Localization;
|
||||
|
||||
public class LocalizationKey : BaseEntity<uint>
|
||||
public class LocalizationKey : BaseEntity<Guid>
|
||||
{
|
||||
public List<LocalizationText> Texts { get; set; }
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
using FictionArchive.Common.Enums;
|
||||
using FictionArchive.Service.NovelService.Models.Novels;
|
||||
using FictionArchive.Service.Shared.Models;
|
||||
|
||||
namespace FictionArchive.Service.NovelService.Models.Localization;
|
||||
|
||||
public class LocalizationRequest : BaseEntity<Guid>
|
||||
{
|
||||
public LocalizationKey KeyRequestedForTranslation { get; set; }
|
||||
public Language TranslateTo { get; set; }
|
||||
public TranslationEngine Engine { get; set; }
|
||||
}
|
||||
@@ -4,7 +4,7 @@ using FictionArchive.Service.Shared.Models;
|
||||
|
||||
namespace FictionArchive.Service.NovelService.Models.Localization;
|
||||
|
||||
public class LocalizationText : BaseEntity<uint>
|
||||
public class LocalizationText : BaseEntity<Guid>
|
||||
{
|
||||
public Language Language { get; set; }
|
||||
public string Text { get; set; }
|
||||
|
||||
@@ -5,5 +5,4 @@ namespace FictionArchive.Service.NovelService.Models.Novels;
|
||||
public class TranslationEngine : BaseEntity<uint>
|
||||
{
|
||||
public string Key { get; set; }
|
||||
public string DisplayName { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user