21 lines
662 B
C#
21 lines
662 B
C#
using FluentResults;
|
|
using NexusReader.Application.Abstractions.Messaging;
|
|
using NexusReader.Application.Abstractions.Services;
|
|
|
|
namespace NexusReader.Application.Queries.Reader;
|
|
|
|
internal sealed class GetReaderPageQueryHandler : IQueryHandler<GetReaderPageQuery, ReaderPageViewModel>
|
|
{
|
|
private readonly IEpubService _epubService;
|
|
|
|
public GetReaderPageQueryHandler(IEpubService epubService)
|
|
{
|
|
_epubService = epubService;
|
|
}
|
|
|
|
public async Task<Result<ReaderPageViewModel>> Handle(GetReaderPageQuery request, CancellationToken cancellationToken)
|
|
{
|
|
return await _epubService.GetEpubContentAsync(request.ChapterIndex);
|
|
}
|
|
}
|