forked from ddrilling/AsbCloudServer
42 lines
2.1 KiB
C#
42 lines
2.1 KiB
C#
using System;
|
||
using AsbCloudApp.Data;
|
||
using System.Collections.Generic;
|
||
using Microsoft.AspNetCore.Mvc;
|
||
using Microsoft.AspNetCore.Authorization;
|
||
|
||
namespace AsbCloudWebApi.Controllers
|
||
{
|
||
[Route("api/analytics")]
|
||
[ApiController]
|
||
[Authorize]
|
||
public class AnalyticsController : ControllerBase
|
||
{
|
||
/// <summary>
|
||
/// Возвращает данные по операциям на скважине за период
|
||
/// </summary>
|
||
/// <param name="wellId">id скважины</param>
|
||
/// <param name="begin">дата начала интервала</param>
|
||
/// <param name="end">дата окончания интервала</param>
|
||
/// <returns>Коллекцию операций на скважине</returns>
|
||
[HttpGet]
|
||
[Route("{wellId}/get")]
|
||
[ProducesResponseType(typeof(List<OperationPercentageDto>), (int)System.Net.HttpStatusCode.OK)]
|
||
public IActionResult GetAnalytics(int wellId, DateTime begin = default, DateTime end = default)
|
||
{
|
||
var analytics = new List<OperationPercentageDto>
|
||
{
|
||
new OperationPercentageDto { ProcessName = "Роторное бурение", Percentage = 19.7 },
|
||
new OperationPercentageDto { ProcessName = "Подъем с проработкой", Percentage = 6.2 },
|
||
new OperationPercentageDto { ProcessName = "Спуск с проработкой", Percentage = 9.4 },
|
||
new OperationPercentageDto { ProcessName = "Подъем с промывкой", Percentage = 18.4 },
|
||
new OperationPercentageDto { ProcessName = "Неподвижное состояние", Percentage = 12.1 },
|
||
new OperationPercentageDto { ProcessName = "Вращение без циркуляции", Percentage = 7.4 },
|
||
new OperationPercentageDto { ProcessName = "Спуск в скважину", Percentage = 16.7 },
|
||
new OperationPercentageDto { ProcessName = "На поверхности", Percentage = 10.1 }
|
||
};
|
||
|
||
return Ok(analytics);
|
||
}
|
||
}
|
||
}
|