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
|
namespace AsbCloudApp.Data.SAUB
|
||||||
{
|
{
|
||||||
#nullable enable
|
#nullable enable
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// DTO телеметрии наработки талевого каната
|
/// DTO телеметрии наработки талевого каната от панели бурильщика
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class TelemetryWirelineRunOutDto
|
public class TelemetryWirelineRunOutBaseDto
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// отметка времени
|
/// отметка времени
|
||||||
@ -32,6 +33,13 @@ namespace AsbCloudApp.Data.SAUB
|
|||||||
/// Наработка талевого каната до сигнализации о необходимости замены, т*км
|
/// Наработка талевого каната до сигнализации о необходимости замены, т*км
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public float ReplaceWarnSp { get; set; }
|
public float ReplaceWarnSp { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// DTO телеметрии наработки талевого каната
|
||||||
|
/// </summary>
|
||||||
|
public class TelemetryWirelineRunOutDto : TelemetryWirelineRunOutBaseDto
|
||||||
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Информация по скважине
|
/// Информация по скважине
|
||||||
|
@ -19,7 +19,7 @@ namespace AsbCloudApp.Repositories
|
|||||||
/// <param name="dto"></param>
|
/// <param name="dto"></param>
|
||||||
/// <param name="token"></param>
|
/// <param name="token"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<int> AddOrUpdateAsync(string uid, TelemetryWirelineRunOutDto dto, CancellationToken token);
|
Task<int> AddOrUpdateAsync(string uid, TelemetryWirelineRunOutBaseDto dto, CancellationToken token);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Выдает данные по скважине
|
/// Выдает данные по скважине
|
||||||
|
@ -29,7 +29,7 @@ namespace AsbCloudInfrastructure.Repository
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <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 idTelemetry = telemetryService.GetOrCreateTelemetryIdByUid(uid);
|
||||||
var timezoneOffset = telemetryService.GetTimezone(idTelemetry).Hours;
|
var timezoneOffset = telemetryService.GetTimezone(idTelemetry).Hours;
|
||||||
@ -93,7 +93,7 @@ namespace AsbCloudInfrastructure.Repository
|
|||||||
return result;
|
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>();
|
var entity = dto.Adapt<TelemetryWirelineRunOut>();
|
||||||
entity.IdTelemetry = idTelemetry;
|
entity.IdTelemetry = idTelemetry;
|
||||||
|
@ -48,7 +48,7 @@ namespace AsbCloudWebApi.Controllers.SAUB
|
|||||||
[HttpPost]
|
[HttpPost]
|
||||||
[Route("{uid}")]
|
[Route("{uid}")]
|
||||||
[AllowAnonymous]
|
[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)
|
if (dto is null)
|
||||||
return BadRequest("Dto shouldn't be null");
|
return BadRequest("Dto shouldn't be null");
|
||||||
|
Loading…
Reference in New Issue
Block a user