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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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