rename some methods

This commit is contained in:
Фролов 2022-03-02 16:21:07 +05:00
parent 055e6daf85
commit ef1d2dda91
5 changed files with 11 additions and 12 deletions

View File

@ -10,7 +10,7 @@ namespace AsbCloudApp.Services
Task<ClusterRopStatDto> GetRopStatByIdWellAsync(int idWell, CancellationToken token);
Task<ClusterRopStatDto> GetRopStatByUidAsync(string uid, CancellationToken token);
Task<StatClusterDto> GetStatClusterAsync(int idCluster, int idCompany, CancellationToken token = default);
Task<StatWellDto> GetStatWellAsync(int idWell, CancellationToken token = default);
Task<StatWellDto> GetWellStatAsync(int idWell, CancellationToken token = default);
Task<IEnumerable<PlanFactPredictBase<WellOperationDto>>> GetTvdAsync(int idWell, CancellationToken token);
Task<IEnumerable<StatWellDto>> GetWellsStatAsync(IEnumerable<int> idWells, CancellationToken token);
}

View File

@ -16,7 +16,7 @@ namespace AsbCloudInfrastructure.Services.DrillingProgram
{
public class DrillingProgramService : IDrillingProgramService
{
private static Dictionary<string, DrillingProgramCreateError> drillingProgramCreateErrors = new Dictionary<string, DrillingProgramCreateError>();
private static readonly Dictionary<string, DrillingProgramCreateError> drillingProgramCreateErrors = new Dictionary<string, DrillingProgramCreateError>();
private readonly IAsbCloudDbContext context;
private readonly IFileService fileService;

View File

@ -95,13 +95,13 @@ namespace AsbCloudInfrastructure.Services.WellOperationService
foreach (var well in wells)
{
var statWellDto = await CalcStatWellAsync(well, token);
var statWellDto = await CalcWellStatAsync(well, token);
statsWells.Add(statWellDto);
}
return statsWells;
}
public async Task<StatWellDto> GetStatWellAsync(int idWell,
public async Task<StatWellDto> GetWellStatAsync(int idWell,
CancellationToken token = default)
{
var well = await db.Wells
@ -109,7 +109,7 @@ namespace AsbCloudInfrastructure.Services.WellOperationService
.FirstOrDefaultAsync(w => w.Id == idWell, token)
.ConfigureAwait(false);
var statWellDto = await CalcStatWellAsync(well, token);
var statWellDto = await CalcWellStatAsync(well, token);
return statWellDto;
}
@ -160,7 +160,7 @@ namespace AsbCloudInfrastructure.Services.WellOperationService
return clusterRops;
}
private async Task<StatWellDto> CalcStatWellAsync(Well well, CancellationToken token = default)
private async Task<StatWellDto> CalcWellStatAsync(Well well, CancellationToken token = default)
{
var wellType = await cacheWellType.FirstOrDefaultAsync(t => t.Id == well.IdWellType, token);
var statWellDto = new StatWellDto()

View File

@ -59,7 +59,6 @@ namespace AsbCloudWebApi.Controllers
/// <param name="token"> Токен отмены задачи </param>
/// <returns> Возвращает файл программы бурения </returns>
[HttpGet]
[Permission]
[ProducesResponseType(typeof(DrillingProgramStateDto), (int)System.Net.HttpStatusCode.OK)]
public async Task<IActionResult> GetStateAsync(int idWell, CancellationToken token)
{
@ -82,7 +81,7 @@ namespace AsbCloudWebApi.Controllers
/// <param name="idWell"></param>
/// <returns></returns>
[HttpPost("ClearError")]
[Permission]
[Permission("DrillingProgram.get")]
public IActionResult ClearError(int idWell)
{
drillingProgramService.ClearError(idWell);
@ -98,7 +97,7 @@ namespace AsbCloudWebApi.Controllers
/// <param name="token"></param>
/// <returns></returns>
[HttpPost("part/{idFileCategory}")]
[Permission]
[Permission("DrillingProgram.get")]
[ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)]
public async Task<IActionResult> AddFile(
int idWell,
@ -249,7 +248,7 @@ namespace AsbCloudWebApi.Controllers
/// <param name="token"> Токен отмены задачи </param>
/// <returns></returns>
[HttpPost("fileMark")]
[Permission]
[Permission("DrillingProgram.get")]
public async Task<IActionResult> AddOrReplaceFileMarkAsync(int idWell, FileMarkDto markDto, CancellationToken token)
{
var idCompany = User.GetCompanyId();
@ -275,7 +274,7 @@ namespace AsbCloudWebApi.Controllers
/// <param name="token"> Токен отмены задачи </param>
/// <returns></returns>
[HttpDelete("fileMark/{idMark}")]
[Permission]
[Permission("DrillingProgram.get")]
[ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)]
public async Task<IActionResult> MarkAsDeletedFileMarkAsync(int idWell, int idMark,
CancellationToken token)

View File

@ -126,7 +126,7 @@ namespace AsbCloudWebApi.Controllers
if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false))
return Forbid();
var result = await operationsStatService.GetStatWellAsync(idWell, token)
var result = await operationsStatService.GetWellStatAsync(idWell, token)
.ConfigureAwait(false);
return Ok(result);
}