feat: implement cross-device reading progress synchronization using SignalR and remove legacy quiz generation services.

This commit is contained in:
2026-05-02 19:55:07 +02:00
parent e5611758f1
commit 94ecc7a404
22 changed files with 332 additions and 69 deletions
@@ -1,9 +0,0 @@
using FluentResults;
using NexusReader.Application.Queries.Quiz;
namespace NexusReader.Application.Abstractions.Services;
public interface IAiGenerateQuizService
{
Task<Result<QuizDto>> GenerateQuizAsync(string contextBlockId, CancellationToken cancellationToken = default);
}
@@ -0,0 +1,6 @@
using FluentResults;
using MediatR;
namespace NexusReader.Application.Commands.Sync;
public record UpdateReadingProgressCommand(string PageId, string UserId) : IRequest<Result>;
@@ -1,5 +0,0 @@
using NexusReader.Application.Abstractions.Messaging;
namespace NexusReader.Application.Queries.Quiz;
public record GetQuizQuestionsQuery(string ContextBlockId) : IQuery<QuizDto>;
@@ -1,20 +0,0 @@
using FluentResults;
using NexusReader.Application.Abstractions.Messaging;
using NexusReader.Application.Abstractions.Services;
namespace NexusReader.Application.Queries.Quiz;
internal sealed class GetQuizQuestionsQueryHandler : IQueryHandler<GetQuizQuestionsQuery, QuizDto>
{
private readonly IAiGenerateQuizService _aiService;
public GetQuizQuestionsQueryHandler(IAiGenerateQuizService aiService)
{
_aiService = aiService;
}
public async Task<Result<QuizDto>> Handle(GetQuizQuestionsQuery request, CancellationToken cancellationToken)
{
return await _aiService.GenerateQuizAsync(request.ContextBlockId, cancellationToken);
}
}