forked from ddrilling/AsbCloudServer
43 lines
1.3 KiB
C#
43 lines
1.3 KiB
C#
using AsbCloudApp.Data;
|
||
using AsbCloudApp.Services;
|
||
using Microsoft.AspNetCore.Authorization;
|
||
using Microsoft.AspNetCore.Mvc;
|
||
using System;
|
||
using System.Collections.Generic;
|
||
using System.Linq;
|
||
using System.Threading.Tasks;
|
||
|
||
namespace AsbCloudWebApi.Controllers
|
||
{
|
||
/// <summary>
|
||
/// Контроллер сбора данных от буровых
|
||
/// </summary>
|
||
[Route("api/well")]
|
||
[ApiController]
|
||
[Authorize]
|
||
public class DataController : ControllerBase
|
||
{
|
||
private readonly ITelemetryDataService telemetryDataService;
|
||
|
||
public DataController(ITelemetryDataService telemetryDataService)
|
||
{
|
||
this.telemetryDataService = telemetryDataService;
|
||
}
|
||
|
||
/// <summary>
|
||
/// Возвращает данные САУБ по скважине.
|
||
/// По умолчанию за последние 10 минут.
|
||
/// </summary>
|
||
/// <param name="wellId"></param>
|
||
/// <param name=""></param>
|
||
/// <returns></returns>
|
||
[HttpGet]
|
||
[Route("{wellId}/data")]
|
||
[ProducesResponseType(typeof(IEnumerable<DataSaubBaseDto>), (int)System.Net.HttpStatusCode.OK)]
|
||
public IActionResult Get(int wellId)
|
||
{
|
||
return Ok(telemetryDataService.Get(wellId));
|
||
}
|
||
}
|
||
}
|