HelpPage исправлена орфография, маршруты. Добавлена валидация

This commit is contained in:
ngfrolov 2023-06-30 17:00:27 +05:00
parent a0720e9270
commit c6d776a92c
Signed by untrusted user who does not match committer: ng.frolov
GPG Key ID: E99907A0357B29A7
2 changed files with 5 additions and 4 deletions

View File

@ -19,7 +19,7 @@ public class HelpPageDto : IId
public int IdCategory { get; set; }
/// <summary>
/// Url страницы, которой пренадлежит справка
/// Url страницы, которой принадлежит справка
/// </summary>
public string UrlPage { get; set; } = null!;

View File

@ -39,9 +39,10 @@ public class HelpPageController : ControllerBase
/// <returns></returns>
[HttpPost]
[Permission]
[Route("upload")]
[ProducesResponseType(typeof(int), (int)HttpStatusCode.OK)]
public async Task<IActionResult> UploadAsync(string urlPage,
public async Task<IActionResult> UploadAsync(
string urlPage,
[Range(minimum: 20000, maximum: 20000, ErrorMessage = "Категория файла недопустима. Допустимые: 20000")]
int idCategory,
[Required] IFormFile file,
CancellationToken cancellationToken)
@ -73,7 +74,7 @@ public class HelpPageController : ControllerBase
/// <param name="cancellationToken">Токен для отмены задачи</param>
/// <returns></returns>
[HttpGet]
[Route("get/{urlPage}/{idCategory}")]
[Route("{urlPage}/{idCategory}")]
[ProducesResponseType(typeof(PhysicalFileResult), (int)HttpStatusCode.OK)]
[ProducesResponseType(StatusCodes.Status204NoContent)]
public async Task<IActionResult> GetFileAsync(string urlPage,