diff --git a/src/Inshapardaz.Api/Controllers/BookPageController.cs b/src/Inshapardaz.Api/Controllers/BookPageController.cs index 4af5e4e0..5720f316 100644 --- a/src/Inshapardaz.Api/Controllers/BookPageController.cs +++ b/src/Inshapardaz.Api/Controllers/BookPageController.cs @@ -202,9 +202,9 @@ public async Task GetPagesByBook(int libraryId, [HttpPost("libraries/{libraryId}/books/{bookId}/pages/{sequenceNumber}/ocr", Name = nameof(BookPageController.OcrPage))] [Authorize(Role.Admin, Role.LibraryAdmin, Role.Writer)] - public async Task OcrPage(int libraryId, int bookId, int sequenceNumber, [FromBody] string apiKey, CancellationToken token = default(CancellationToken)) + public async Task OcrPage(int libraryId, int bookId, int sequenceNumber, [FromBody] OcrRequest ocrRequest, CancellationToken token = default(CancellationToken)) { - var request = new BookPageOcrRequest(libraryId, bookId, sequenceNumber, apiKey); + var request = new BookPageOcrRequest(libraryId, bookId, sequenceNumber, ocrRequest.Key); await _commandProcessor.SendAsync(request, cancellationToken: token); return Ok(); diff --git a/src/Inshapardaz.Api/Views/FileView.cs b/src/Inshapardaz.Api/Views/FileView.cs index ee709c6f..ffdff2f6 100644 --- a/src/Inshapardaz.Api/Views/FileView.cs +++ b/src/Inshapardaz.Api/Views/FileView.cs @@ -12,4 +12,4 @@ public class FileView : ViewWithLinks public DateTime DateCreated { get; set; } } -} \ No newline at end of file +} diff --git a/src/Inshapardaz.Api/Views/OcrRequest.cs b/src/Inshapardaz.Api/Views/OcrRequest.cs new file mode 100644 index 00000000..3316236c --- /dev/null +++ b/src/Inshapardaz.Api/Views/OcrRequest.cs @@ -0,0 +1,10 @@ +using System.ComponentModel.DataAnnotations; + +namespace Inshapardaz.Api.Views +{ + public class OcrRequest + { + [Required] + public string Key { get; set; } + } +} diff --git a/src/Inshapardaz.Api/appsettings.Development.json b/src/Inshapardaz.Api/appsettings.Development.json index e2c25438..ac0ff8cd 100644 --- a/src/Inshapardaz.Api/appsettings.Development.json +++ b/src/Inshapardaz.Api/appsettings.Development.json @@ -4,8 +4,9 @@ "LogLevel": { "Default": "Debug", "System": "Information", - "Microsoft": "None", - "Paramore": "Information" + "Microsoft": "Information", + "Microsoft.Hosting.Lifetime": "Information", + "Paramore": "Error" } }, "AppSettings": {