using FictionArchive.Service.NovelService.Models.Enums; using FictionArchive.Service.NovelService.Models.IntegrationEvents; using FictionArchive.Service.NovelService.Models.Localization; using FictionArchive.Service.NovelService.Models.Novels; using FictionArchive.Service.NovelService.Models.SourceAdapters; using FictionArchive.Service.NovelService.Services; using FictionArchive.Service.NovelService.Services.SourceAdapters; using FictionArchive.Service.Shared.Services.EventBus; using Microsoft.EntityFrameworkCore; namespace FictionArchive.Service.NovelService.GraphQL; public class Mutation { public async Task ImportNovel(string novelUrl, IEventBus eventBus) { var importNovelRequestEvent = new NovelUpdateRequestedEvent() { NovelUrl = novelUrl }; await eventBus.Publish(importNovelRequestEvent); return importNovelRequestEvent; } public async Task FetchChapterContents(uint novelId, uint chapterNumber, IEventBus eventBus) { var chapterPullEvent = new ChapterPullRequestedEvent() { NovelId = novelId, ChapterNumber = chapterNumber }; await eventBus.Publish(chapterPullEvent); return chapterPullEvent; } }