forked from ddrilling/AsbCloudServer
fix TelemetryWirelineRunOut. make wellinfo optional for POST request.
This commit is contained in:
parent
56e02ffdd8
commit
49678c4973
@ -3,10 +3,11 @@
|
||||
namespace AsbCloudApp.Data.SAUB
|
||||
{
|
||||
#nullable enable
|
||||
|
||||
/// <summary>
|
||||
/// DTO телеметрии наработки талевого каната
|
||||
/// DTO телеметрии наработки талевого каната от панели бурильщика
|
||||
/// </summary>
|
||||
public class TelemetryWirelineRunOutDto
|
||||
public class TelemetryWirelineRunOutBaseDto
|
||||
{
|
||||
/// <summary>
|
||||
/// отметка времени
|
||||
@ -32,6 +33,13 @@ namespace AsbCloudApp.Data.SAUB
|
||||
/// Наработка талевого каната до сигнализации о необходимости замены, т*км
|
||||
/// </summary>
|
||||
public float ReplaceWarnSp { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// DTO телеметрии наработки талевого каната
|
||||
/// </summary>
|
||||
public class TelemetryWirelineRunOutDto : TelemetryWirelineRunOutBaseDto
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Информация по скважине
|
||||
|
@ -19,7 +19,7 @@ namespace AsbCloudApp.Repositories
|
||||
/// <param name="dto"></param>
|
||||
/// <param name="token"></param>
|
||||
/// <returns></returns>
|
||||
Task<int> AddOrUpdateAsync(string uid, TelemetryWirelineRunOutDto dto, CancellationToken token);
|
||||
Task<int> AddOrUpdateAsync(string uid, TelemetryWirelineRunOutBaseDto dto, CancellationToken token);
|
||||
|
||||
/// <summary>
|
||||
/// Выдает данные по скважине
|
||||
|
@ -29,7 +29,7 @@ namespace AsbCloudInfrastructure.Repository
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public async Task<int> AddOrUpdateAsync(string uid, TelemetryWirelineRunOutDto dto, CancellationToken token)
|
||||
public async Task<int> AddOrUpdateAsync(string uid, TelemetryWirelineRunOutBaseDto dto, CancellationToken token)
|
||||
{
|
||||
var idTelemetry = telemetryService.GetOrCreateTelemetryIdByUid(uid);
|
||||
var timezoneOffset = telemetryService.GetTimezone(idTelemetry).Hours;
|
||||
@ -93,7 +93,7 @@ namespace AsbCloudInfrastructure.Repository
|
||||
return result;
|
||||
}
|
||||
|
||||
private static TelemetryWirelineRunOut Convert(int idTelemetry, TelemetryWirelineRunOutDto dto, double timezoneOffset)
|
||||
private static TelemetryWirelineRunOut Convert(int idTelemetry, TelemetryWirelineRunOutBaseDto dto, double timezoneOffset)
|
||||
{
|
||||
var entity = dto.Adapt<TelemetryWirelineRunOut>();
|
||||
entity.IdTelemetry = idTelemetry;
|
||||
|
@ -48,7 +48,7 @@ namespace AsbCloudWebApi.Controllers.SAUB
|
||||
[HttpPost]
|
||||
[Route("{uid}")]
|
||||
[AllowAnonymous]
|
||||
public IActionResult PostData(string uid, [FromBody] TelemetryWirelineRunOutDto dto, CancellationToken token)
|
||||
public IActionResult PostData(string uid, [FromBody] TelemetryWirelineRunOutBaseDto dto, CancellationToken token)
|
||||
{
|
||||
if (dto is null)
|
||||
return BadRequest("Dto shouldn't be null");
|
||||
|
Loading…
Reference in New Issue
Block a user