main
|
Last change
on this file since a6e33d1 was a6e33d1, checked in by kikisrbinoska <srbinoskakristina07@…>, 3 days ago |
|
AI suggestions fixed
|
-
Property mode
set to
100644
|
|
File size:
943 bytes
|
| Rev | Line | |
|---|
| [a6e33d1] | 1 | using ChapterX.Domain.Repositories;
|
|---|
| 2 | using MediatR;
|
|---|
| 3 | using Microsoft.Extensions.Logging;
|
|---|
| 4 |
|
|---|
| 5 | namespace ChapterX.Application.AISuggestion.Queries
|
|---|
| 6 | {
|
|---|
| 7 | public class GetByChapterHandler : IRequestHandler<GetByChapterRequest, GetByChapterResponse>
|
|---|
| 8 | {
|
|---|
| 9 | private readonly IAISuggestionRepository _aiSuggestionRepository;
|
|---|
| 10 | private readonly ILogger<GetByChapterHandler> _logger;
|
|---|
| 11 |
|
|---|
| 12 | public GetByChapterHandler(IAISuggestionRepository aiSuggestionRepository, ILogger<GetByChapterHandler> logger)
|
|---|
| 13 | {
|
|---|
| 14 | _aiSuggestionRepository = aiSuggestionRepository;
|
|---|
| 15 | _logger = logger;
|
|---|
| 16 | }
|
|---|
| 17 |
|
|---|
| 18 | public async Task<GetByChapterResponse> Handle(GetByChapterRequest request, CancellationToken cancellationToken)
|
|---|
| 19 | {
|
|---|
| 20 | var suggestions = await _aiSuggestionRepository.GetByChapterIdAsync(request.ChapterId, cancellationToken);
|
|---|
| 21 | return new GetByChapterResponse(suggestions);
|
|---|
| 22 | }
|
|---|
| 23 | }
|
|---|
| 24 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.