using ChapterX.Domain.Repositories; using MediatR; using Microsoft.Extensions.Logging; namespace ChapterX.Application.AISuggestion.Queries { public class GetByChapterHandler : IRequestHandler { private readonly IAISuggestionRepository _aiSuggestionRepository; private readonly ILogger _logger; public GetByChapterHandler(IAISuggestionRepository aiSuggestionRepository, ILogger logger) { _aiSuggestionRepository = aiSuggestionRepository; _logger = logger; } public async Task Handle(GetByChapterRequest request, CancellationToken cancellationToken) { var suggestions = await _aiSuggestionRepository.GetByChapterIdAsync(request.ChapterId, cancellationToken); return new GetByChapterResponse(suggestions); } } }