forked from ddrilling/AsbCloudServer
HelpPage исправлена орфография, маршруты. Добавлена валидация
This commit is contained in:
parent
a0720e9270
commit
c6d776a92c
@ -19,7 +19,7 @@ public class HelpPageDto : IId
|
|||||||
public int IdCategory { get; set; }
|
public int IdCategory { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Url страницы, которой пренадлежит справка
|
/// Url страницы, которой принадлежит справка
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string UrlPage { get; set; } = null!;
|
public string UrlPage { get; set; } = null!;
|
||||||
|
|
||||||
|
@ -39,9 +39,10 @@ public class HelpPageController : ControllerBase
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[Permission]
|
[Permission]
|
||||||
[Route("upload")]
|
|
||||||
[ProducesResponseType(typeof(int), (int)HttpStatusCode.OK)]
|
[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,
|
int idCategory,
|
||||||
[Required] IFormFile file,
|
[Required] IFormFile file,
|
||||||
CancellationToken cancellationToken)
|
CancellationToken cancellationToken)
|
||||||
@ -73,7 +74,7 @@ public class HelpPageController : ControllerBase
|
|||||||
/// <param name="cancellationToken">Токен для отмены задачи</param>
|
/// <param name="cancellationToken">Токен для отмены задачи</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("get/{urlPage}/{idCategory}")]
|
[Route("{urlPage}/{idCategory}")]
|
||||||
[ProducesResponseType(typeof(PhysicalFileResult), (int)HttpStatusCode.OK)]
|
[ProducesResponseType(typeof(PhysicalFileResult), (int)HttpStatusCode.OK)]
|
||||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||||
public async Task<IActionResult> GetFileAsync(string urlPage,
|
public async Task<IActionResult> GetFileAsync(string urlPage,
|
||||||
|
Loading…
Reference in New Issue
Block a user