forked from ddrilling/AsbCloudServer
Убрано лишнее
This commit is contained in:
parent
c8c0ea37fe
commit
183d07639e
@ -17,7 +17,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[Route("api/well/{idWell}/files")]
|
[Route("api/well/{idWell}/files")]
|
||||||
[ApiController]
|
[ApiController]
|
||||||
//[Authorize]
|
[Authorize]
|
||||||
public class FileController : ControllerBase
|
public class FileController : ControllerBase
|
||||||
{
|
{
|
||||||
private readonly FileService fileService;
|
private readonly FileService fileService;
|
||||||
@ -39,7 +39,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// <param name="token"> Токен отмены задачи </param>
|
/// <param name="token"> Токен отмены задачи </param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
//[Permission]
|
[Permission]
|
||||||
[ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)]
|
[ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)]
|
||||||
public async Task<IActionResult> SaveFilesAsync(int idWell, int idCategory,
|
public async Task<IActionResult> SaveFilesAsync(int idWell, int idCategory,
|
||||||
[FromForm] IFormFileCollection files, [FromServices] IUserRepository userRepository, CancellationToken token)
|
[FromForm] IFormFileCollection files, [FromServices] IUserRepository userRepository, CancellationToken token)
|
||||||
@ -60,7 +60,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
foreach (var file in files)
|
foreach (var file in files)
|
||||||
{
|
{
|
||||||
var fileStream = file.OpenReadStream();
|
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);
|
fileStream, token).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user