From 183d07639e21ea689c1e283ef2fa48e9af318639 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9E=D0=BB=D1=8F=20=D0=91=D0=B8=D0=B7=D1=8E=D0=BA=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0?= Date: Fri, 19 Jan 2024 10:42:02 +0500 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B1=D1=80=D0=B0=D0=BD=D0=BE=20=D0=BB?= =?UTF-8?q?=D0=B8=D1=88=D0=BD=D0=B5=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AsbCloudWebApi/Controllers/FileController.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/AsbCloudWebApi/Controllers/FileController.cs b/AsbCloudWebApi/Controllers/FileController.cs index 713b3731..e9a7990b 100644 --- a/AsbCloudWebApi/Controllers/FileController.cs +++ b/AsbCloudWebApi/Controllers/FileController.cs @@ -17,7 +17,7 @@ namespace AsbCloudWebApi.Controllers /// [Route("api/well/{idWell}/files")] [ApiController] - //[Authorize] + [Authorize] public class FileController : ControllerBase { private readonly FileService fileService; @@ -39,7 +39,7 @@ namespace AsbCloudWebApi.Controllers /// Токен отмены задачи /// [HttpPost] - //[Permission] + [Permission] [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] public async Task SaveFilesAsync(int idWell, int idCategory, [FromForm] IFormFileCollection files, [FromServices] IUserRepository userRepository, CancellationToken token) @@ -60,7 +60,7 @@ namespace AsbCloudWebApi.Controllers foreach (var file in files) { var fileStream = file.OpenReadStream(); - await fileService.SaveAsync(idWell, idUser ?? 1, idCategory, file.FileName, + await fileService.SaveAsync(idWell, idUser ?? 0, idCategory, file.FileName, fileStream, token).ConfigureAwait(false); }