forked from ddrilling/AsbCloudServer
Merge pull request 'Фикс API автопределенных операций' (#268) from fix/api_detected_operations into dev
Reviewed-on: http://test.digitaldrilling.ru:8080/DDrilling/AsbCloudServer/pulls/268
This commit is contained in:
commit
657db5597a
@ -72,6 +72,7 @@ namespace AsbCloudApp.Services
|
||||
/// <param name="request"></param>
|
||||
/// <param name="token"></param>
|
||||
/// <returns></returns>
|
||||
[Obsolete]
|
||||
Task<IEnumerable<DetectedOperationStatDto>> GetOperationsStatAsync(DetectedOperationByWellRequest request, CancellationToken token);
|
||||
|
||||
/// <summary>
|
||||
|
@ -143,6 +143,7 @@ public class DetectedOperationService : IDetectedOperationService
|
||||
}
|
||||
}
|
||||
|
||||
[Obsolete]
|
||||
public async Task<IEnumerable<DetectedOperationStatDto>> GetOperationsStatAsync(DetectedOperationByWellRequest request, CancellationToken token)
|
||||
{
|
||||
var well = await wellService.GetOrDefaultAsync(request.IdWell, token);
|
||||
|
@ -1,4 +1,5 @@
|
||||
using AsbCloudApp.Data.DetectedOperation;
|
||||
using System;
|
||||
using AsbCloudApp.Data.DetectedOperation;
|
||||
using AsbCloudApp.Requests;
|
||||
using AsbCloudApp.Services;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
@ -110,7 +111,7 @@ namespace AsbCloudWebApi.Controllers.SAUB
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Получить фильтрованный список операций по телеметрии САУБ
|
||||
/// Получить список автоопределенных операций для редактирования
|
||||
/// </summary>
|
||||
/// <param name="idWell"></param>
|
||||
/// <param name="request"></param>
|
||||
@ -118,7 +119,7 @@ namespace AsbCloudWebApi.Controllers.SAUB
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[ProducesResponseType(typeof(PaginationContainer<DetectedOperationDto>), StatusCodes.Status200OK)]
|
||||
public async Task<IActionResult> GetAsync(int idWell, [FromQuery] DetectedOperationRequest request,
|
||||
public async Task<IActionResult> GetPageAsync(int idWell, [FromQuery] DetectedOperationRequest request,
|
||||
CancellationToken token)
|
||||
{
|
||||
await AssertUserHasAccessToWellAsync(idWell, token);
|
||||
@ -133,24 +134,23 @@ namespace AsbCloudWebApi.Controllers.SAUB
|
||||
var result = await detectedOperationRepository.GetPageAsync(requestToService, token);
|
||||
return Ok(result);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Получить статистику по фильтрованному списку операций по телеметрии САУБ
|
||||
/// Получить статистику по автоопределенным операциям
|
||||
/// </summary>
|
||||
/// <param name="idWell"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="token"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("stat")]
|
||||
[ProducesResponseType(typeof(IEnumerable<DetectedOperationStatDto>), StatusCodes.Status200OK)]
|
||||
public async Task<IActionResult> GetStatAsync(int idWell, [FromQuery] DetectedOperationRequest request,
|
||||
CancellationToken token)
|
||||
[ProducesResponseType(typeof(DetectedOperationListDto), StatusCodes.Status200OK)]
|
||||
public async Task<IActionResult> GetAsync(int idWell, [FromQuery] DetectedOperationRequest request, CancellationToken token)
|
||||
{
|
||||
await AssertUserHasAccessToWellAsync(idWell, token);
|
||||
|
||||
|
||||
var requestToService = new DetectedOperationByWellRequest(idWell, request);
|
||||
|
||||
var result = await detectedOperationService.GetOperationsStatAsync(requestToService, token);
|
||||
var result = await detectedOperationService.GetAsync(requestToService, token);
|
||||
return Ok(result);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user