Fixed controllers routes

This commit is contained in:
KharchenkoVV 2021-08-17 09:39:05 +05:00
parent d1f67dc69c
commit 0e662d4868
8 changed files with 21 additions and 24 deletions

View File

@ -13,7 +13,7 @@ namespace AsbCloudWebApi.Controllers
/// <summary>
/// Контроллер сбора данных от буровых
/// </summary>
[Route("api/well")]
[Route("api/well/{idWell}/data")]
[ApiController]
[Authorize]
public class DataController : ControllerBase
@ -38,7 +38,6 @@ namespace AsbCloudWebApi.Controllers
/// <param name="token">Токен завершения задачи</param>
/// <returns></returns>
[HttpGet]
[Route("{idWell}/data")]
[ProducesResponseType(typeof(IEnumerable<DataSaubBaseDto>), (int)System.Net.HttpStatusCode.OK)]
public async Task<IActionResult> GetDataAsync(int idWell, DateTime begin = default,
int intervalSec = 600, int approxPointsCount = 1024, CancellationToken token = default)
@ -61,7 +60,7 @@ namespace AsbCloudWebApi.Controllers
/// <param name="token">Токен завершения задачи</param>
/// <returns></returns>
[HttpGet]
[Route("{idWell}/dataDatesRange")]
[Route("dataDatesRange")]
[ProducesResponseType(typeof(DatesRangeDto), (int)System.Net.HttpStatusCode.OK)]
public async Task<IActionResult> GetDataDatesRangeAsync(int idWell,
CancellationToken token = default)

View File

@ -5,7 +5,7 @@ using Microsoft.AspNetCore.Mvc;
namespace AsbCloudWebApi.Controllers
{
[Route("api/fluidLastData/{idWell}")]
[Route("api/well/{idWell}/fluidLastData")]
[ApiController]
[Authorize]
public class FluidController : LastDataController<FluidDataDto>

View File

@ -8,7 +8,7 @@ using System.Threading.Tasks;
namespace AsbCloudWebApi.Controllers
{
[Route("api/well")]
[Route("api/well/{idWell}/message")]
[ApiController]
public class MessageController : ControllerBase
{
@ -34,7 +34,6 @@ namespace AsbCloudWebApi.Controllers
/// <param name="token">Токен для отмены задачи</param>
/// <returns>список сообщений по скважине</returns>
[HttpGet]
[Route("{idWell}/message")]
[ProducesResponseType(typeof(PaginationContainer<MessageDto>), (int)System.Net.HttpStatusCode.OK)]
public async Task<IActionResult> GetMessagesAsync(int idWell, int skip = 0, int take = 32,
[FromQuery] IEnumerable<int> categoryids = default,
@ -65,7 +64,7 @@ namespace AsbCloudWebApi.Controllers
/// <param name="token">Токен для отмены задачи</param>
/// <returns>список сообщений по скважине</returns>
[HttpGet]
[Route("{idWell}/messagesDatesRange")]
[Route("datesRange")]
[ProducesResponseType(typeof(DatesRangeDto), (int)System.Net.HttpStatusCode.OK)]
public async Task<IActionResult> GetMessagesDateRangeAsync(int idWell,
CancellationToken token = default)

View File

@ -5,7 +5,7 @@ using Microsoft.AspNetCore.Mvc;
namespace AsbCloudWebApi.Controllers
{
[Route("api/mudLastData/{idWell}")]
[Route("api/well/{idWell}/mudLastData")]
[ApiController]
[Authorize]
public class MudDiagramController : LastDataController<MudDiagramDataDto>

View File

@ -5,7 +5,7 @@ using Microsoft.AspNetCore.Mvc;
namespace AsbCloudWebApi.Controllers
{
[Route("api/nnbLastData/{idWell}")]
[Route("api/well/{idWell}/nnbLastData")]
[ApiController]
[Authorize]
public class NnbDataController : LastDataController<NnbDataDto>

View File

@ -15,7 +15,7 @@ namespace AsbCloudWebApi.Controllers
/// <summary>
/// Контроллер отчетов по буровым скважинам
/// </summary>
[Route("api/report")]
[Route("api/well/{idWell}/report")]
[ApiController]
public class ReportController : ControllerBase
{
@ -64,7 +64,6 @@ namespace AsbCloudWebApi.Controllers
/// <param name="token">Токен для отмены задачи</param>
/// <returns>id фоновой задачи формирования отчета</returns>
[HttpPost]
[Route("{idWell}/report")]
[ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)]
public async Task<IActionResult> CreateReportAsync(int idWell, int idUser, int stepSeconds, int format,
DateTime begin = default, DateTime end = default,
@ -93,7 +92,7 @@ namespace AsbCloudWebApi.Controllers
/// <param name="token">Токен для отмены задачи</param>
/// <returns>файл с отчетом</returns>
[HttpGet]
[Route("{idWell}/{reportName}")]
[Route("{reportName}")]
[ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK)]
public async Task<IActionResult> GetReportAsync([FromRoute] int idWell,
string reportName, CancellationToken token = default)
@ -132,7 +131,7 @@ namespace AsbCloudWebApi.Controllers
/// <param name="token">Токен для отмены задачи</param>
/// <returns>Список имен существующих отчетов (отчетов)</returns>
[HttpGet]
[Route("{idWell}/suitableReports")]
[Route("suitableReports")]
[ProducesResponseType(typeof(IEnumerable<string>), (int)System.Net.HttpStatusCode.OK)]
public async Task<IActionResult> GetSuitableReportsNamesAsync(int idWell, int stepSeconds, int format,
DateTime begin = default, DateTime end = default,
@ -158,7 +157,7 @@ namespace AsbCloudWebApi.Controllers
/// <param name="token">Токен для отмены задачи</param>
/// <returns>прогнозируемое кол-во страниц отчета</returns>
[HttpGet]
[Route("{idWell}/reportSize")]
[Route("reportSize")]
[ProducesResponseType(typeof(string), (int)System.Net.HttpStatusCode.OK)]
public async Task<IActionResult> GetReportSizeAsync(int idWell,
int stepSeconds, int format, DateTime begin = default,
@ -186,7 +185,7 @@ namespace AsbCloudWebApi.Controllers
/// <param name="token">Токен для отмены задачи</param>
/// <returns>Даты самого старого и самого свежего отчетов в БД</returns>
[HttpGet]
[Route("{idWell}/reportsDatesRange")]
[Route("datesRange")]
[ProducesResponseType(typeof(DatesRangeDto), (int)System.Net.HttpStatusCode.OK)]
public async Task<IActionResult> GetReportsDateRangeAsync(int idWell,
CancellationToken token = default)

View File

@ -10,7 +10,7 @@ using System.Threading.Tasks;
namespace AsbCloudWebApi.Controllers
{
[Route("api/analytics")]
[Route("api/well/{idWell}/telemetryAnalytics")]
[ApiController]
[Authorize]
public class TelemetryAnalyticsController : ControllerBase
@ -36,7 +36,7 @@ namespace AsbCloudWebApi.Controllers
/// <param name="token"> Токен отмены задачи </param>
/// <returns>Список операций на скважине за все время</returns>
[HttpGet]
[Route("{idWell}/operationsByWell")]
[Route("operationsByWell")]
[ProducesResponseType(typeof(PaginationContainer<TelemetryOperationDto>), (int)System.Net.HttpStatusCode.OK)]
public async Task<IActionResult> GetOperationsByWellAsync(int idWell, int skip = 0, int take = 32,
[FromQuery] IEnumerable<int> categoryIds = default, DateTime begin = default, DateTime end = default,
@ -64,7 +64,7 @@ namespace AsbCloudWebApi.Controllers
/// <param name="token">Токен отмены задачи</param>
/// <returns>Коллекцию данных по скважине "глубина-день"</returns>
[HttpGet]
[Route("{idWell}/wellDepthToDay")]
[Route("wellDepthToDay")]
[ProducesResponseType(typeof(IEnumerable<WellDepthToDayDto>), (int)System.Net.HttpStatusCode.OK)]
public async Task<IActionResult> GetWellDepthToDayAsync(int idWell,
CancellationToken token = default)
@ -93,7 +93,7 @@ namespace AsbCloudWebApi.Controllers
/// <param name="token">Токен отмены задачи</param>
/// <returns>Коллекцию данных по глубине скважины за период</returns>
[HttpGet]
[Route("{idWell}/wellDepthToInterval")]
[Route("wellDepthToInterval")]
[ProducesResponseType(typeof(IEnumerable<WellDepthToIntervalDto>), (int)System.Net.HttpStatusCode.OK)]
public async Task<IActionResult> GetWellDepthToIntervalAsync(int idWell,
int intervalSeconds, int workBeginSeconds, CancellationToken token = default)
@ -122,7 +122,7 @@ namespace AsbCloudWebApi.Controllers
/// <param name="token">Токен отмены задачи</param>
/// <returns>Коллекцию операций на скважине</returns>
[HttpGet]
[Route("{idWell}/operationsSummary")]
[Route("operationsSummary")]
[ProducesResponseType(typeof(IEnumerable<TelemetryOperationDurationDto>), (int)System.Net.HttpStatusCode.OK)]
public async Task<IActionResult> GetOperationsSummaryAsync(int idWell, DateTime begin = default,
DateTime end = default, CancellationToken token = default)
@ -151,7 +151,7 @@ namespace AsbCloudWebApi.Controllers
/// <param name="token">Токен отмены задачи</param>
/// <returns>Коллекцию операций на скважине</returns>
[HttpGet]
[Route("{idWell}/operationsToInterval")]
[Route("operationsToInterval")]
[ProducesResponseType(typeof(IEnumerable<TelemetryOperationDurationDto>), (int)System.Net.HttpStatusCode.OK)]
public async Task<IActionResult> GetOperationsToIntervalAsync(int idWell,
int intervalSeconds, int workBeginSeconds, CancellationToken token = default)

View File

@ -11,7 +11,7 @@ namespace AsbCloudWebApi.Controllers
/// <summary>
/// Контроллер вручную внесенных операций на скважине
/// </summary>
[Route("api/wellOperations")]
[Route("api/well/{idWell}/wellOperations")]
[ApiController]
[Authorize]
public class WellOperationController : ControllerBase
@ -30,9 +30,9 @@ namespace AsbCloudWebApi.Controllers
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("types")]
[Route("categories")]
[ProducesResponseType(typeof(IEnumerable<string>), (int)System.Net.HttpStatusCode.OK)]
public IActionResult GetTypes()
public IActionResult GetCategories()
{
var result = operationService.GetCategories();
return Ok(result);