rename lastDataService to measureService

This commit is contained in:
Фролов 2021-08-31 09:52:15 +05:00
parent 4e0e9b93d7
commit ebd3e4ec4c

View File

@ -12,12 +12,12 @@ namespace AsbCloudWebApi.Controllers
[Route("api/well/{idWell}/measure")] [Route("api/well/{idWell}/measure")]
public class MeasureController: ControllerBase public class MeasureController: ControllerBase
{ {
private readonly IMeasureService lastDataService; private readonly IMeasureService measureService;
private readonly IWellService wellService; private readonly IWellService wellService;
public MeasureController(IMeasureService lastDataService, IWellService wellService) public MeasureController(IMeasureService measureService, IWellService wellService)
{ {
this.lastDataService = lastDataService; this.measureService = measureService;
this.wellService = wellService; this.wellService = wellService;
} }
@ -28,7 +28,7 @@ namespace AsbCloudWebApi.Controllers
if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false))
return Forbid(); return Forbid();
var result = await lastDataService.GetCategoriesAsync(token).ConfigureAwait(false); var result = await measureService.GetCategoriesAsync(token).ConfigureAwait(false);
return Ok(result); return Ok(result);
} }
@ -39,7 +39,7 @@ namespace AsbCloudWebApi.Controllers
if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false))
return Forbid(); return Forbid();
var result = await lastDataService.GetAllLastAsync(idWell, token).ConfigureAwait(false); var result = await measureService.GetAllLastAsync(idWell, token).ConfigureAwait(false);
return Ok(result); return Ok(result);
} }
@ -50,7 +50,7 @@ namespace AsbCloudWebApi.Controllers
if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false))
return Forbid(); return Forbid();
var result = await lastDataService.GetLastAsync(idWell, idCategory, token).ConfigureAwait(false); var result = await measureService.GetLastAsync(idWell, idCategory, token).ConfigureAwait(false);
return Ok(result); return Ok(result);
} }
@ -61,7 +61,7 @@ namespace AsbCloudWebApi.Controllers
if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false))
return Forbid(); return Forbid();
var result = await lastDataService.GetHisoryAsync(idWell, idCategory, token).ConfigureAwait(false); var result = await measureService.GetHisoryAsync(idWell, idCategory, token).ConfigureAwait(false);
return Ok(result); return Ok(result);
} }
@ -71,7 +71,7 @@ namespace AsbCloudWebApi.Controllers
if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false))
return Forbid(); return Forbid();
var result = await lastDataService.InsertAsync(idWell, data, token).ConfigureAwait(false); var result = await measureService.InsertAsync(idWell, data, token).ConfigureAwait(false);
return Ok(result); return Ok(result);
} }
@ -81,17 +81,18 @@ namespace AsbCloudWebApi.Controllers
if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false))
return Forbid(); return Forbid();
var result = await lastDataService.UpdateAsync(idWell, data, token).ConfigureAwait(false); var result = await measureService.UpdateAsync(idWell, data, token).ConfigureAwait(false);
return Ok(result); return Ok(result);
} }
[HttpDelete] [HttpDelete]
[Route("history/{idData}")]
public async Task<IActionResult> MarkAsDeleteAsync([FromRoute] int idWell, [FromRoute] int idData, CancellationToken token = default) public async Task<IActionResult> MarkAsDeleteAsync([FromRoute] int idWell, [FromRoute] int idData, CancellationToken token = default)
{ {
if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false))
return Forbid(); return Forbid();
var result = await lastDataService.MarkAsDeleteAsync(idWell, idData, token).ConfigureAwait(false); var result = await measureService.MarkAsDeleteAsync(idWell, idData, token).ConfigureAwait(false);
return Ok(result); return Ok(result);
} }