forked from ddrilling/AsbCloudServer
ProcessMapController Add GetByUidAsync, mark as obsolete GetByTelemetry
This commit is contained in:
parent
5a0b92a1ec
commit
151eaadcb9
@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Authorization;
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
@ -35,10 +36,32 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// <param name="token"> Токен отмены задачи </param>
|
/// <param name="token"> Токен отмены задачи </param>
|
||||||
/// <returns> Список параметров для коридоров бурения </returns>
|
/// <returns> Список параметров для коридоров бурения </returns>
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
|
[Obsolete("use GetByUidAsync(..) instead")]
|
||||||
[Route("/api/telemetry/{uid}/drillFlowChart")]
|
[Route("/api/telemetry/{uid}/drillFlowChart")]
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
[ProducesResponseType(typeof(IEnumerable<ProcessMapDto>), (int)System.Net.HttpStatusCode.OK)]
|
[ProducesResponseType(typeof(IEnumerable<ProcessMapDto>), (int)System.Net.HttpStatusCode.OK)]
|
||||||
public async Task<IActionResult> GetByTelemetryAsync(string uid, DateTime updateFrom, CancellationToken token)
|
public IActionResult GetByTelemetry(string uid, DateTime updateFrom, CancellationToken token)
|
||||||
|
{
|
||||||
|
var idWell = telemetryService.GetIdWellByTelemetryUid(uid);
|
||||||
|
if (idWell is null)
|
||||||
|
return BadRequest($"Wrong uid {uid}");
|
||||||
|
|
||||||
|
var dto = Enumerable.Empty<ProcessMapDto>();
|
||||||
|
return Ok(dto);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Возвращает все значения для коридоров бурения по uid панели
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="uid"> uid панели </param>
|
||||||
|
/// <param name="updateFrom"> Дата, с которой следует искать новые параметры </param>
|
||||||
|
/// <param name="token"> Токен отмены задачи </param>
|
||||||
|
/// <returns> Список параметров для коридоров бурения </returns>
|
||||||
|
[HttpGet]
|
||||||
|
[Route("/api/telemetry/{uid}/processMap")]
|
||||||
|
[AllowAnonymous]
|
||||||
|
[ProducesResponseType(typeof(IEnumerable<ProcessMapDto>), (int)System.Net.HttpStatusCode.OK)]
|
||||||
|
public async Task<IActionResult> GetByUidAsync(string uid, DateTime updateFrom, CancellationToken token)
|
||||||
{
|
{
|
||||||
var idWell = telemetryService.GetIdWellByTelemetryUid(uid);
|
var idWell = telemetryService.GetIdWellByTelemetryUid(uid);
|
||||||
if (idWell is null)
|
if (idWell is null)
|
||||||
@ -77,7 +100,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
return await base.InsertAsync(value, token);
|
return await base.InsertAsync(value, token);
|
||||||
}
|
}
|
||||||
|
|
||||||
// <summary>
|
/// <summary>
|
||||||
/// Редактировать запись по id
|
/// Редактировать запись по id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="value">запись</param>
|
/// <param name="value">запись</param>
|
||||||
|
Loading…
Reference in New Issue
Block a user