Дополнить исправления
This commit is contained in:
parent
dd888793fd
commit
2228c84139
@ -101,10 +101,11 @@ public class SetpointController : ControllerBase, ISetpointApi
|
||||
/// <param name="token"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[ProducesResponseType(typeof(int), (int)HttpStatusCode.OK)]
|
||||
public async Task<IActionResult> Add(Guid setpointKey, object newValue, Guid idUser, CancellationToken token)
|
||||
[ProducesResponseType(typeof(int), (int)HttpStatusCode.Created)]
|
||||
public async Task<IActionResult> Add(Guid setpointKey, object newValue, CancellationToken token)
|
||||
{
|
||||
await setpointRepository.Add(setpointKey, newValue, idUser, token);
|
||||
var userId = User.GetUserId<Guid>();
|
||||
await setpointRepository.Add(setpointKey, newValue, userId, token);
|
||||
|
||||
return CreatedAtAction(nameof(Add), true);
|
||||
}
|
||||
|
@ -110,12 +110,8 @@ public class TechMessagesController : ControllerBase
|
||||
public async Task<IActionResult> AddRange([FromBody] IEnumerable<TechMessageDto> dtos, CancellationToken token)
|
||||
{
|
||||
var userId = User.GetUserId<Guid>();
|
||||
foreach (var dto in dtos)
|
||||
{
|
||||
dto.UserId = userId;
|
||||
}
|
||||
|
||||
var result = await techMessagesRepository.AddRange(dtos, token);
|
||||
var result = await techMessagesRepository.AddRange(dtos, userId, token);
|
||||
|
||||
return CreatedAtAction(nameof(AddRange), result);
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ namespace Persistence.Repository.Repositories
|
||||
return result;
|
||||
}
|
||||
|
||||
public async Task<int> AddRange(IEnumerable<TechMessageDto> dtos, CancellationToken token)
|
||||
public async Task<int> AddRange(IEnumerable<TechMessageDto> dtos, Guid userId, CancellationToken token)
|
||||
{
|
||||
|
||||
var entities = new List<TechMessage>();
|
||||
@ -100,6 +100,7 @@ namespace Persistence.Repository.Repositories
|
||||
?? await CreateDrillingSystem(dto.System, token);
|
||||
|
||||
entity.SystemId = systemId;
|
||||
entity.UserId = userId;
|
||||
|
||||
entities.Add(entity);
|
||||
}
|
||||
|
@ -40,5 +40,5 @@ public interface ISetpointApi : ISyncApi<SetpointLogDto>
|
||||
/// <param name="newValue">значение</param>
|
||||
/// <param name="token"></param>
|
||||
/// <returns></returns>
|
||||
Task<IActionResult> Add(Guid setpointKey, object newValue, Guid userId, CancellationToken token);
|
||||
Task<IActionResult> Add(Guid setpointKey, object newValue, CancellationToken token);
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ namespace Persistence.Repositories
|
||||
/// <param name="dtos"></param>
|
||||
/// <param name="token"></param>
|
||||
/// <returns></returns>
|
||||
Task<int> AddRange(IEnumerable<TechMessageDto> dtos, CancellationToken token);
|
||||
Task<int> AddRange(IEnumerable<TechMessageDto> dtos, Guid userId, CancellationToken token);
|
||||
|
||||
/// <summary>
|
||||
/// Получение списка уникальных названий систем АБ
|
||||
|
Loading…
Reference in New Issue
Block a user