From ecc62c840421901f572d1d9cdbb4b4a3037f444e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=82=D0=B5=D0=BF=D0=B0=D0=BD=D0=BE=D0=B2=20=D0=94?= =?UTF-8?q?=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9=20=D0=90=D0=BB=D0=B5=D0=BA?= =?UTF-8?q?=D1=81=D0=B0=D0=BD=D0=B4=D1=80=D0=BE=D0=B2=D0=B8=D1=87?= Date: Mon, 3 Jul 2023 14:33:34 +0500 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=B4=D0=B5=D0=BB=D0=B0=D0=BB=20=D0=BE?= =?UTF-8?q?=D0=B1=D1=8F=D0=B7=D0=B0=D1=82=D0=B5=D0=BB=D1=8C=D0=BD=D1=8B?= =?UTF-8?q?=D0=B9=20CancellationToken=20=D0=B2=20=D0=BA=D0=BE=D0=BD=D1=82?= =?UTF-8?q?=D1=80=D0=BE=D0=BB=D0=BB=D0=B5=D1=80=D0=B0=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/AdminTelemetryController.cs | 2 +- AsbCloudWebApi/Controllers/AuthController.cs | 4 ++-- AsbCloudWebApi/Controllers/DepositController.cs | 6 +++--- .../Controllers/DrillingProgramController.cs | 4 ++-- AsbCloudWebApi/Controllers/FileController.cs | 16 +++++++--------- .../Controllers/LimitingParameterController.cs | 2 +- AsbCloudWebApi/Controllers/MeasureController.cs | 15 ++++++++------- .../Controllers/OperationStatController.cs | 12 ++++++------ .../Controllers/PlannedTrajectoryController.cs | 14 +++++++------- AsbCloudWebApi/Controllers/ReportController.cs | 15 +++++++++------ .../SAUB/DetectedOperationController.cs | 9 ++++----- .../Controllers/SAUB/GtrWitsController.cs | 7 +++---- .../Controllers/SAUB/MessageController.cs | 6 ++---- .../Controllers/SAUB/SetpointsController.cs | 10 +++++----- .../SAUB/TelemetryDataBaseController.cs | 10 ++++++---- .../SubsystemOperationTimeController.cs | 10 +++++----- .../Controllers/WITS/WitsControllerAbstract.cs | 2 +- .../Controllers/WellCompositeController.cs | 8 ++++---- AsbCloudWebApi/Controllers/WellController.cs | 10 +++++----- .../Controllers/WellFinalDocumentsController.cs | 2 +- 20 files changed, 82 insertions(+), 82 deletions(-) diff --git a/AsbCloudWebApi/Controllers/AdminTelemetryController.cs b/AsbCloudWebApi/Controllers/AdminTelemetryController.cs index b55d623a..b9f30009 100644 --- a/AsbCloudWebApi/Controllers/AdminTelemetryController.cs +++ b/AsbCloudWebApi/Controllers/AdminTelemetryController.cs @@ -31,7 +31,7 @@ namespace AsbCloudWebApi.Controllers [HttpPost] [Route("/merge/{idFrom}/{idTo}")] [Permission] - public async Task MergeTelemetriesAsync(int idFrom, int idTo, CancellationToken token = default) + public async Task MergeTelemetriesAsync(int idFrom, int idTo, CancellationToken token) { var count = await telemetryService.MergeAsync(idFrom, idTo, token) .ConfigureAwait(false); diff --git a/AsbCloudWebApi/Controllers/AuthController.cs b/AsbCloudWebApi/Controllers/AuthController.cs index 5318c6ec..ca3143ba 100644 --- a/AsbCloudWebApi/Controllers/AuthController.cs +++ b/AsbCloudWebApi/Controllers/AuthController.cs @@ -38,7 +38,7 @@ namespace AsbCloudWebApi.Controllers [HttpPost("login")] [SwaggerOperation(OperationId = "login")] [ProducesResponseType(typeof(UserTokenDto), (int)System.Net.HttpStatusCode.OK)] - public async Task LoginAsync([FromBody] AuthDto auth, CancellationToken token = default) + public async Task LoginAsync([FromBody] AuthDto auth, CancellationToken token) { var userToken = await authService.LoginAsync(auth.Login, auth.Password, token); @@ -55,7 +55,7 @@ namespace AsbCloudWebApi.Controllers [Authorize] [HttpGet("refresh")] [ProducesResponseType(typeof(UserTokenDto), (int)System.Net.HttpStatusCode.OK)] - public async Task RefreshAsync(CancellationToken token = default) + public async Task RefreshAsync(CancellationToken token) { var userToken = await authService.RefreshAsync(User, token); diff --git a/AsbCloudWebApi/Controllers/DepositController.cs b/AsbCloudWebApi/Controllers/DepositController.cs index f1f89506..9b8d0c91 100644 --- a/AsbCloudWebApi/Controllers/DepositController.cs +++ b/AsbCloudWebApi/Controllers/DepositController.cs @@ -31,7 +31,7 @@ namespace AsbCloudWebApi.Controllers [HttpGet] [Permission] [ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)] - public async Task GetDepositsAsync(CancellationToken token = default) + public async Task GetDepositsAsync(CancellationToken token) { int? idCompany = User.GetCompanyId(); @@ -51,7 +51,7 @@ namespace AsbCloudWebApi.Controllers [HttpGet("drillParamsWells")] [Permission] [ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)] - public async Task GetDepositsDrillParamsAsync(CancellationToken token = default) + public async Task GetDepositsDrillParamsAsync(CancellationToken token) { int? idCompany = User.GetCompanyId(); @@ -73,7 +73,7 @@ namespace AsbCloudWebApi.Controllers [Permission] [ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)] public async Task GetClustersAsync(int depositId, - CancellationToken token = default) + CancellationToken token) { int? idCompany = User.GetCompanyId(); diff --git a/AsbCloudWebApi/Controllers/DrillingProgramController.cs b/AsbCloudWebApi/Controllers/DrillingProgramController.cs index fc4eeb11..69944c9d 100644 --- a/AsbCloudWebApi/Controllers/DrillingProgramController.cs +++ b/AsbCloudWebApi/Controllers/DrillingProgramController.cs @@ -196,7 +196,7 @@ namespace AsbCloudWebApi.Controllers [HttpPost("part/{idFileCategory}/user")] [Permission] [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] - public async Task AddUserAsync(int idWell, [Required] int idUser, int idFileCategory, [Required] int idUserRole, CancellationToken token = default) + public async Task AddUserAsync(int idWell, [Required] int idUser, int idFileCategory, [Required] int idUserRole, CancellationToken token) { int? idCompany = User.GetCompanyId(); int? idUserEditor = User.GetUserId(); @@ -224,7 +224,7 @@ namespace AsbCloudWebApi.Controllers [HttpDelete("part/{idFileCategory}/user/{idUser}")] [Permission] [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] - public async Task RemoveUserAsync(int idWell, int idUser, int idFileCategory, [Required] int idUserRole, CancellationToken token = default) + public async Task RemoveUserAsync(int idWell, int idUser, int idFileCategory, [Required] int idUserRole, CancellationToken token) { int? idCompany = User.GetCompanyId(); int? idUserEditor = User.GetUserId(); diff --git a/AsbCloudWebApi/Controllers/FileController.cs b/AsbCloudWebApi/Controllers/FileController.cs index 0bb69891..2a7d6fcb 100644 --- a/AsbCloudWebApi/Controllers/FileController.cs +++ b/AsbCloudWebApi/Controllers/FileController.cs @@ -7,8 +7,6 @@ using Microsoft.AspNetCore.Mvc; using System.IO; using System.Threading; using System.Threading.Tasks; -using AsbCloudDb.Model; -using AsbCloudInfrastructure.Repository; using AsbCloudApp.Repositories; namespace AsbCloudWebApi.Controllers @@ -44,7 +42,7 @@ namespace AsbCloudWebApi.Controllers [Permission] [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] public async Task SaveFilesAsync(int idWell, int idCategory, - [FromForm] IFormFileCollection files, [FromServices] IUserRepository userRepository, CancellationToken token = default) + [FromForm] IFormFileCollection files, [FromServices] IUserRepository userRepository, CancellationToken token) { int? idCompany = User.GetCompanyId(); int? idUser = User.GetUserId(); @@ -81,7 +79,7 @@ namespace AsbCloudWebApi.Controllers [ProducesResponseType(typeof(PaginationContainer), (int)System.Net.HttpStatusCode.OK)] public async Task GetFilesInfoAsync( [FromQuery] FileRequest request, - CancellationToken token = default) + CancellationToken token) { int? idCompany = User.GetCompanyId(); @@ -108,7 +106,7 @@ namespace AsbCloudWebApi.Controllers [Permission] [ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK)] public async Task GetFileAsync( - int idFile, CancellationToken token = default) + int idFile, CancellationToken token) { int? idCompany = User.GetCompanyId(); @@ -142,7 +140,7 @@ namespace AsbCloudWebApi.Controllers [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] public async Task DeleteAsync(int idWell, int idFile, [FromServices] IUserRepository userRepository, - CancellationToken token = default) + CancellationToken token) { int? idUser = User.GetUserId(); @@ -174,7 +172,7 @@ namespace AsbCloudWebApi.Controllers /// [HttpPost("fileMark")] [Permission] - public async Task CreateFileMarkAsync(int idWell, FileMarkDto markDto, CancellationToken token = default) + public async Task CreateFileMarkAsync(int idWell, FileMarkDto markDto, CancellationToken token) { var idCompany = User.GetCompanyId(); @@ -202,7 +200,7 @@ namespace AsbCloudWebApi.Controllers [Permission] [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] public async Task DeleteFileMarkAsync(int idWell, int idMark, - CancellationToken token = default) + CancellationToken token) { var idCompany = User.GetCompanyId(); @@ -226,7 +224,7 @@ namespace AsbCloudWebApi.Controllers [Route("/api/files/{idFile}")] [Permission] [ProducesResponseType(typeof(FileInfoDto), (int)System.Net.HttpStatusCode.OK)] - public async Task GetFileInfoAsync([FromRoute] int idFile, CancellationToken token = default) + public async Task GetFileInfoAsync([FromRoute] int idFile, CancellationToken token) { int? idCompany = User.GetCompanyId(); diff --git a/AsbCloudWebApi/Controllers/LimitingParameterController.cs b/AsbCloudWebApi/Controllers/LimitingParameterController.cs index 9bd5784d..7157dd03 100644 --- a/AsbCloudWebApi/Controllers/LimitingParameterController.cs +++ b/AsbCloudWebApi/Controllers/LimitingParameterController.cs @@ -32,7 +32,7 @@ namespace AsbCloudWebApi.Controllers /// [HttpGet("stat")] [ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)] - public async Task GetStatAsync([FromQuery] LimitingParameterRequest request, CancellationToken token = default) + public async Task GetStatAsync([FromQuery] LimitingParameterRequest request, CancellationToken token) { if (!await UserHasAccesToWellAsync(request.IdWell, token)) return Forbid(); diff --git a/AsbCloudWebApi/Controllers/MeasureController.cs b/AsbCloudWebApi/Controllers/MeasureController.cs index dac77733..510a34ca 100644 --- a/AsbCloudWebApi/Controllers/MeasureController.cs +++ b/AsbCloudWebApi/Controllers/MeasureController.cs @@ -27,7 +27,7 @@ namespace AsbCloudWebApi.Controllers [HttpGet] [Permission] [Route("categories")] - public async Task GetCategoriesAsync([FromRoute] int idWell, CancellationToken token = default) + public async Task GetCategoriesAsync([FromRoute] int idWell, CancellationToken token) { if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) return Forbid(); @@ -39,7 +39,7 @@ namespace AsbCloudWebApi.Controllers [HttpGet] [Permission] [Route("last/{idCategory}")] - public async Task GetLastAsync([FromRoute] int idWell, [FromRoute] int idCategory, CancellationToken token = default) + public async Task GetLastAsync([FromRoute] int idWell, [FromRoute] int idCategory, CancellationToken token) { if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) return Forbid(); @@ -58,7 +58,8 @@ namespace AsbCloudWebApi.Controllers [HttpGet] [Permission] [Route("history")] - public async Task GetHisoryAsync([FromRoute] int idWell, int? idCategory = null, CancellationToken token = default) + public async Task GetHisoryAsync([FromRoute] int idWell, CancellationToken token, + int? idCategory = null) { if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) return Forbid(); @@ -69,7 +70,7 @@ namespace AsbCloudWebApi.Controllers [HttpPost] [Permission] - public async Task InsertAsync([FromRoute] int idWell, MeasureDto data, CancellationToken token = default) + public async Task InsertAsync([FromRoute] int idWell, MeasureDto data, CancellationToken token) { if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) return Forbid(); @@ -80,7 +81,7 @@ namespace AsbCloudWebApi.Controllers [HttpPut] [Permission] - public async Task UpdateAsync([FromRoute] int idWell, MeasureDto data, CancellationToken token = default) + public async Task UpdateAsync([FromRoute] int idWell, MeasureDto data, CancellationToken token) { if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) return Forbid(); @@ -92,7 +93,7 @@ namespace AsbCloudWebApi.Controllers [HttpDelete] [Permission] [Route("history/{idData}")] - public async Task MarkAsDeleteAsync([FromRoute] int idWell, [FromRoute] int idData, CancellationToken token = default) + public async Task MarkAsDeleteAsync([FromRoute] int idWell, [FromRoute] int idData, CancellationToken token) { if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) return Forbid(); @@ -101,7 +102,7 @@ namespace AsbCloudWebApi.Controllers return Ok(result); } - private async Task CanUserAccessToWellAsync(int idWell, CancellationToken token = default) + private async Task CanUserAccessToWellAsync(int idWell, CancellationToken token) { int? idCompany = User.GetCompanyId(); return idCompany is not null && await wellService.IsCompanyInvolvedInWellAsync((int)idCompany, diff --git a/AsbCloudWebApi/Controllers/OperationStatController.cs b/AsbCloudWebApi/Controllers/OperationStatController.cs index a10dcd93..9fa4f5bd 100644 --- a/AsbCloudWebApi/Controllers/OperationStatController.cs +++ b/AsbCloudWebApi/Controllers/OperationStatController.cs @@ -37,7 +37,7 @@ namespace AsbCloudWebApi.Controllers [Permission] [ProducesResponseType(typeof(ClusterRopStatDto), (int)System.Net.HttpStatusCode.OK)] public async Task GetClusterRopStatByIdWellAsync([FromRoute] int idWell, - CancellationToken token = default) + CancellationToken token) { if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) return Forbid(); @@ -58,7 +58,7 @@ namespace AsbCloudWebApi.Controllers [ProducesResponseType(typeof(ClusterRopStatDto), (int)System.Net.HttpStatusCode.OK)] [AllowAnonymous] public async Task GetClusterRopStatByUidAsync([FromRoute] string uid, - CancellationToken token = default) + CancellationToken token) { var idWell = wellService.TelemetryService.GetIdWellByTelemetryUid(uid); @@ -82,7 +82,7 @@ namespace AsbCloudWebApi.Controllers [Permission] [ProducesResponseType(typeof(StatClusterDto), (int)System.Net.HttpStatusCode.OK)] public async Task GetStatClusterAsync(int idCluster, - CancellationToken token = default) + CancellationToken token) { int? idCompany = User.GetCompanyId(); if (idCompany is null) @@ -128,7 +128,7 @@ namespace AsbCloudWebApi.Controllers [Permission] [ProducesResponseType(typeof(StatWellDto), (int)System.Net.HttpStatusCode.OK)] public async Task GetStatWellAsync(int idWell, - CancellationToken token = default) + CancellationToken token) { if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) return Forbid(); @@ -149,7 +149,7 @@ namespace AsbCloudWebApi.Controllers [Permission] [ProducesResponseType(typeof(IEnumerable>), (int)System.Net.HttpStatusCode.OK)] public async Task GetTvdAsync(int idWell, - CancellationToken token = default) + CancellationToken token) { if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) return Forbid(); @@ -159,7 +159,7 @@ namespace AsbCloudWebApi.Controllers return Ok(result); } - private async Task CanUserAccessToWellAsync(int idWell, CancellationToken token = default) + private async Task CanUserAccessToWellAsync(int idWell, CancellationToken token) { int? idCompany = User.GetCompanyId(); return idCompany is not null && await wellService.IsCompanyInvolvedInWellAsync((int)idCompany, diff --git a/AsbCloudWebApi/Controllers/PlannedTrajectoryController.cs b/AsbCloudWebApi/Controllers/PlannedTrajectoryController.cs index 1e8b667d..5da1a2c2 100644 --- a/AsbCloudWebApi/Controllers/PlannedTrajectoryController.cs +++ b/AsbCloudWebApi/Controllers/PlannedTrajectoryController.cs @@ -61,7 +61,7 @@ namespace AsbCloudWebApi.Controllers [HttpGet] [Route("export")] [ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK)] - public async Task ExportAsync([FromRoute] int idWell, CancellationToken token = default) + public async Task ExportAsync([FromRoute] int idWell, CancellationToken token) { if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) @@ -120,7 +120,7 @@ namespace AsbCloudWebApi.Controllers [HttpGet] [Route("getRows")] [ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)] - public async Task GetAsync([FromRoute] int idWell, CancellationToken token = default) + public async Task GetAsync([FromRoute] int idWell, CancellationToken token) { if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) @@ -140,7 +140,7 @@ namespace AsbCloudWebApi.Controllers [Route("addRow")] [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] public async Task AddAsync(int idWell, [FromBody] TrajectoryGeoPlanDto row, - CancellationToken token = default) + CancellationToken token) { if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) return Forbid(); @@ -164,7 +164,7 @@ namespace AsbCloudWebApi.Controllers [Route("addRangeRows")] [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] public async Task AddRangeAsync(int idWell, [FromBody] IEnumerable rows, - CancellationToken token = default) + CancellationToken token) { if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) return Forbid(); @@ -191,7 +191,7 @@ namespace AsbCloudWebApi.Controllers [HttpPut("{idRow}")] [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] public async Task UpdateAsync(int idWell, int idRow, - [FromBody] TrajectoryGeoPlanDto row, CancellationToken token = default) + [FromBody] TrajectoryGeoPlanDto row, CancellationToken token) { if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) return Forbid(); @@ -214,7 +214,7 @@ namespace AsbCloudWebApi.Controllers /// количество успешно удаленных строк из БД [HttpDelete("{idRow}")] [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] - public async Task DeleteAsync(int idWell, int idRow, CancellationToken token = default) + public async Task DeleteAsync(int idWell, int idRow, CancellationToken token) { if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) @@ -243,7 +243,7 @@ namespace AsbCloudWebApi.Controllers return Ok(result); } - private async Task CanUserAccessToWellAsync(int idWell, CancellationToken token = default) + private async Task CanUserAccessToWellAsync(int idWell, CancellationToken token) { int? idCompany = User.GetCompanyId(); return idCompany is not null && await wellService.IsCompanyInvolvedInWellAsync((int)idCompany, diff --git a/AsbCloudWebApi/Controllers/ReportController.cs b/AsbCloudWebApi/Controllers/ReportController.cs index 8b1081ab..262692a9 100644 --- a/AsbCloudWebApi/Controllers/ReportController.cs +++ b/AsbCloudWebApi/Controllers/ReportController.cs @@ -45,8 +45,8 @@ namespace AsbCloudWebApi.Controllers [Permission] [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] public async Task CreateReportAsync(int idWell, int stepSeconds, int format, - DateTime begin = default, DateTime end = default, - CancellationToken token = default) + CancellationToken token, + DateTime begin = default, DateTime end = default) { var idCompany = User.GetCompanyId(); var idUser = User.GetUserId(); @@ -83,7 +83,7 @@ namespace AsbCloudWebApi.Controllers [HttpGet] [Permission] [ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)] - public async Task GetAllReportsNamesByWellAsync(int idWell, CancellationToken token = default) + public async Task GetAllReportsNamesByWellAsync(int idWell, CancellationToken token) { int? idCompany = User.GetCompanyId(); @@ -114,8 +114,11 @@ namespace AsbCloudWebApi.Controllers [Permission] [ProducesResponseType(typeof(string), (int)System.Net.HttpStatusCode.OK)] public async Task GetReportSizeAsync(int idWell, - int stepSeconds, int format, DateTime begin = default, - DateTime end = default, CancellationToken token = default) + int stepSeconds, + int format, + CancellationToken token, + DateTime begin = default, + DateTime end = default) { int? idCompany = User.GetCompanyId(); @@ -142,7 +145,7 @@ namespace AsbCloudWebApi.Controllers [Route("datesRange")] [Permission] [ProducesResponseType(typeof(DatesRangeDto), (int)System.Net.HttpStatusCode.OK)] - public async Task GetReportsDateRangeAsync(int idWell, CancellationToken token = default) + public async Task GetReportsDateRangeAsync(int idWell, CancellationToken token) { int? idCompany = User.GetCompanyId(); diff --git a/AsbCloudWebApi/Controllers/SAUB/DetectedOperationController.cs b/AsbCloudWebApi/Controllers/SAUB/DetectedOperationController.cs index ee3ba8f3..02737317 100644 --- a/AsbCloudWebApi/Controllers/SAUB/DetectedOperationController.cs +++ b/AsbCloudWebApi/Controllers/SAUB/DetectedOperationController.cs @@ -5,7 +5,6 @@ using AsbCloudApp.Services; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; using System.Linq; using System.Threading; using System.Threading.Tasks; @@ -38,7 +37,7 @@ namespace AsbCloudWebApi.Controllers.SAUB /// [HttpGet("categories")] [ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)] - public async Task GetCategoriesAsync([FromQuery] int? idWell, CancellationToken token = default) + public async Task GetCategoriesAsync([FromQuery] int? idWell, CancellationToken token) { var result = await detectedOperationService.GetCategoriesAsync(idWell, token); return Ok(result); @@ -54,7 +53,7 @@ namespace AsbCloudWebApi.Controllers.SAUB [ProducesResponseType(typeof(DetectedOperationListDto), (int)System.Net.HttpStatusCode.OK)] public async Task GetAsync( [FromQuery] DetectedOperationRequest request, - CancellationToken token = default) + CancellationToken token) { if (!await UserHasAccesToWellAsync(request.IdWell, token)) return Forbid(); @@ -73,7 +72,7 @@ namespace AsbCloudWebApi.Controllers.SAUB [ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)] public async Task GetStatAsync( [FromQuery] DetectedOperationRequest request, - CancellationToken token = default) + CancellationToken token) { if (!await UserHasAccesToWellAsync(request.IdWell, token)) return Forbid(); @@ -125,7 +124,7 @@ namespace AsbCloudWebApi.Controllers.SAUB [Route("export")] [Permission] [ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK)] - public async Task ExportAsync(int? idWell, int? idCluster, CancellationToken token = default) + public async Task ExportAsync(int? idWell, int? idCluster, CancellationToken token) { if (idCluster is null && idWell is null) return this.MakeBadRequest(nameof(idWell), $"One of {nameof(idWell)} or {nameof(idCluster)} mast be set."); diff --git a/AsbCloudWebApi/Controllers/SAUB/GtrWitsController.cs b/AsbCloudWebApi/Controllers/SAUB/GtrWitsController.cs index a6cf23a2..6c6a57c0 100644 --- a/AsbCloudWebApi/Controllers/SAUB/GtrWitsController.cs +++ b/AsbCloudWebApi/Controllers/SAUB/GtrWitsController.cs @@ -1,7 +1,6 @@ using AsbCloudApp.Data.GTR; using AsbCloudApp.Repositories; using AsbCloudApp.Services; -using AsbCloudDb.Model; using AsbCloudWebApi.SignalR; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.SignalR; @@ -48,8 +47,8 @@ namespace AsbCloudWebApi.Controllers.SAUB /// [HttpGet("{idWell}")] [Permission] - public async Task>> GetDataAsync(int idWell, DateTime? begin, - int intervalSec = 600, int approxPointsCount = 1024, CancellationToken token = default) + public async Task>> GetDataAsync(int idWell, DateTime? begin, + CancellationToken token, int intervalSec = 600, int approxPointsCount = 1024) { int? idCompany = User.GetCompanyId(); @@ -107,7 +106,7 @@ namespace AsbCloudWebApi.Controllers.SAUB public async Task PostDataAsync( string uid, [FromBody] IEnumerable dtos, - CancellationToken token = default) + CancellationToken token) { var telemetry = telemetryService.GetOrCreateTelemetryByUid(uid); await gtrRepository.SaveDataAsync(telemetry.Id, dtos, token).ConfigureAwait(false); diff --git a/AsbCloudWebApi/Controllers/SAUB/MessageController.cs b/AsbCloudWebApi/Controllers/SAUB/MessageController.cs index 89c40692..b2bec1b8 100644 --- a/AsbCloudWebApi/Controllers/SAUB/MessageController.cs +++ b/AsbCloudWebApi/Controllers/SAUB/MessageController.cs @@ -2,8 +2,6 @@ using AsbCloudApp.Requests; using AsbCloudApp.Services; using Microsoft.AspNetCore.Mvc; -using System; -using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; @@ -38,7 +36,7 @@ namespace AsbCloudWebApi.Controllers.SAUB public async Task GetMessagesAsync( [FromRoute] int idWell, [FromQuery] MessageRequestBase request, - CancellationToken token = default) + CancellationToken token) { if (!await UserHasAccesToWellAsync(idWell, token)) @@ -70,7 +68,7 @@ namespace AsbCloudWebApi.Controllers.SAUB [Route("datesRange")] [Permission] [ProducesResponseType(typeof(DatesRangeDto), (int)System.Net.HttpStatusCode.OK)] - public async Task GetMessagesDateRangeAsync(int idWell, CancellationToken token = default) + public async Task GetMessagesDateRangeAsync(int idWell, CancellationToken token) { int? idCompany = User.GetCompanyId(); diff --git a/AsbCloudWebApi/Controllers/SAUB/SetpointsController.cs b/AsbCloudWebApi/Controllers/SAUB/SetpointsController.cs index 3b88c063..a9ec26a5 100644 --- a/AsbCloudWebApi/Controllers/SAUB/SetpointsController.cs +++ b/AsbCloudWebApi/Controllers/SAUB/SetpointsController.cs @@ -51,7 +51,7 @@ namespace AsbCloudWebApi.Controllers.SAUB [HttpPost("api/well/{idWell}/setpoints")] [Permission] [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] - public async Task InsertAsync(int idWell, SetpointsRequestDto setpoints, CancellationToken token = default) + public async Task InsertAsync(int idWell, SetpointsRequestDto setpoints, CancellationToken token) { int? idCompany = User.GetCompanyId(); int? idUser = User.GetUserId(); @@ -90,7 +90,7 @@ namespace AsbCloudWebApi.Controllers.SAUB [HttpGet("api/well/{idWell}/setpoints")] [Permission] [ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)] - public async Task GetByIdWellAsync([FromRoute] int idWell, CancellationToken token = default) + public async Task GetByIdWellAsync([FromRoute] int idWell, CancellationToken token) { int? idCompany = User.GetCompanyId(); int? idUser = User.GetUserId(); @@ -116,7 +116,7 @@ namespace AsbCloudWebApi.Controllers.SAUB [HttpPut("api/telemetry/{uid}/setpoints/{id}")] [ProducesResponseType(typeof(SetpointsRequestDto), (int)System.Net.HttpStatusCode.OK)] [AllowAnonymous] - public async Task UpdateByTelemetryUidAsync([FromRoute] string uid, int id, SetpointsRequestDto setpointsRequestDto, CancellationToken token = default) + public async Task UpdateByTelemetryUidAsync([FromRoute] string uid, int id, SetpointsRequestDto setpointsRequestDto, CancellationToken token) { var result = await setpointsService.UpdateStateAsync(setpointsRequestDto, token) .ConfigureAwait(false); @@ -134,7 +134,7 @@ namespace AsbCloudWebApi.Controllers.SAUB [HttpGet("api/telemetry/{uid}/setpoints")] [ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)] [AllowAnonymous] - public async Task GetByTelemetryUidAsync([FromRoute] string uid, CancellationToken token = default) + public async Task GetByTelemetryUidAsync([FromRoute] string uid, CancellationToken token) { var result = await setpointsService.GetForPanelAsync(uid, token) .ConfigureAwait(false); @@ -151,7 +151,7 @@ namespace AsbCloudWebApi.Controllers.SAUB /// 1 - удалено, 0 и меньше - не удалено [HttpDelete("api/well/{idWell}/setpoints/{id}")] [Permission] - public async Task TryDeleteByIdWellAsync(int idWell, int id, CancellationToken token = default) + public async Task TryDeleteByIdWellAsync(int idWell, int id, CancellationToken token) { int? idCompany = User.GetCompanyId(); int? idUser = User.GetUserId(); diff --git a/AsbCloudWebApi/Controllers/SAUB/TelemetryDataBaseController.cs b/AsbCloudWebApi/Controllers/SAUB/TelemetryDataBaseController.cs index b9c81731..76783bda 100644 --- a/AsbCloudWebApi/Controllers/SAUB/TelemetryDataBaseController.cs +++ b/AsbCloudWebApi/Controllers/SAUB/TelemetryDataBaseController.cs @@ -48,7 +48,7 @@ namespace AsbCloudWebApi.Controllers.SAUB [Route("{uid}")] [AllowAnonymous] public virtual async Task PostDataAsync(string uid, [FromBody] IEnumerable dtos, - CancellationToken token = default) + CancellationToken token) { await telemetryDataService.UpdateDataAsync(uid, dtos, token).ConfigureAwait(false); @@ -72,8 +72,10 @@ namespace AsbCloudWebApi.Controllers.SAUB /// [HttpGet("{idWell}")] [Permission] - public virtual async Task>> GetDataAsync(int idWell, DateTime begin = default, - int intervalSec = 600, int approxPointsCount = 1024, CancellationToken token = default) + public virtual async Task>> GetDataAsync(int idWell, CancellationToken token, + DateTime begin = default, + int intervalSec = 600, + int approxPointsCount = 1024) { int? idCompany = User.GetCompanyId(); @@ -103,7 +105,7 @@ namespace AsbCloudWebApi.Controllers.SAUB [Permission] [ProducesResponseType(typeof(DatesRangeDto), (int)System.Net.HttpStatusCode.OK)] public virtual async Task> GetDataDatesRangeAsync(int idWell, - CancellationToken token = default) + CancellationToken token) { int? idCompany = User.GetCompanyId(); diff --git a/AsbCloudWebApi/Controllers/Subsystems/SubsystemOperationTimeController.cs b/AsbCloudWebApi/Controllers/Subsystems/SubsystemOperationTimeController.cs index 65f503ea..44deb4d9 100644 --- a/AsbCloudWebApi/Controllers/Subsystems/SubsystemOperationTimeController.cs +++ b/AsbCloudWebApi/Controllers/Subsystems/SubsystemOperationTimeController.cs @@ -43,7 +43,7 @@ namespace AsbCloudWebApi.Controllers.Subsystems /// [HttpGet("stat")] [ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)] - public async Task GetStatAsync([FromQuery] SubsystemOperationTimeRequest request, CancellationToken token = default) + public async Task GetStatAsync([FromQuery] SubsystemOperationTimeRequest request, CancellationToken token) { if (!await UserHasAccesToWellAsync(request.IdWell, token)) return Forbid(); @@ -62,7 +62,7 @@ namespace AsbCloudWebApi.Controllers.Subsystems /// [HttpGet("statByActiveWell")] [ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)] - public async Task GetStatByWellAsync(DateTime? GtDate, DateTime? LtDate, CancellationToken token = default) + public async Task GetStatByWellAsync(DateTime? GtDate, DateTime? LtDate, CancellationToken token) { var idCompany = User.GetCompanyId(); if (!idCompany.HasValue) @@ -76,7 +76,7 @@ namespace AsbCloudWebApi.Controllers.Subsystems /// [HttpGet("subsystem")] [ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)] - public async Task GetSubsystemAsync([FromQuery] int? idWell, CancellationToken token = default) + public async Task GetSubsystemAsync([FromQuery] int? idWell, CancellationToken token) { if (idWell.HasValue) if (!await UserHasAccesToWellAsync(idWell.Value, token)) @@ -90,7 +90,7 @@ namespace AsbCloudWebApi.Controllers.Subsystems /// [HttpGet("datesRange")] [ProducesResponseType(typeof(DatesRangeDto), (int)System.Net.HttpStatusCode.OK)] - public async Task GetDateRangeOperationTimeAsync([FromQuery] SubsystemOperationTimeRequest request, CancellationToken token = default) + public async Task GetDateRangeOperationTimeAsync([FromQuery] SubsystemOperationTimeRequest request, CancellationToken token) { if (!await UserHasAccesToWellAsync(request.IdWell, token)) return Forbid(); @@ -106,7 +106,7 @@ namespace AsbCloudWebApi.Controllers.Subsystems public async Task GetOperationTimeAsync( [FromQuery] SubsystemOperationTimeRequest request, - CancellationToken token = default) + CancellationToken token) { if (!await UserHasAccesToWellAsync(request.IdWell, token)) return Forbid(); diff --git a/AsbCloudWebApi/Controllers/WITS/WitsControllerAbstract.cs b/AsbCloudWebApi/Controllers/WITS/WitsControllerAbstract.cs index f2fa2c97..0e29ddd9 100644 --- a/AsbCloudWebApi/Controllers/WITS/WitsControllerAbstract.cs +++ b/AsbCloudWebApi/Controllers/WITS/WitsControllerAbstract.cs @@ -47,7 +47,7 @@ namespace AsbCloudWebApi.Controllers.WITS string uid, [FromBody] IEnumerable dtos, [FromServices] IWitsRecordRepository witsRecordRepository, - CancellationToken token = default) + CancellationToken token) { var telemetry = telemetryService.GetOrCreateTelemetryByUid(uid); await witsRecordRepository.SaveDataAsync(telemetry.Id, dtos, token).ConfigureAwait(false); diff --git a/AsbCloudWebApi/Controllers/WellCompositeController.cs b/AsbCloudWebApi/Controllers/WellCompositeController.cs index 8c155c93..e64118fd 100644 --- a/AsbCloudWebApi/Controllers/WellCompositeController.cs +++ b/AsbCloudWebApi/Controllers/WellCompositeController.cs @@ -38,7 +38,7 @@ namespace AsbCloudWebApi.Controllers [HttpGet] [Permission] [ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)] - public async Task GetAsync(int idWell, CancellationToken token = default) + public async Task GetAsync(int idWell, CancellationToken token) { if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) return Forbid(); @@ -56,7 +56,7 @@ namespace AsbCloudWebApi.Controllers /// [HttpPost] [Permission] - public async Task SaveAsync(int idWell, IEnumerable wellComposites, CancellationToken token = default) + public async Task SaveAsync(int idWell, IEnumerable wellComposites, CancellationToken token) { if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) return Forbid(); @@ -74,7 +74,7 @@ namespace AsbCloudWebApi.Controllers [HttpGet("getCompositeProcessMap")] [Permission] [ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)] - public async Task GetCompositeProcessMap(int idWell, CancellationToken token = default) + public async Task GetCompositeProcessMap(int idWell, CancellationToken token) { if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) return Forbid(); @@ -83,7 +83,7 @@ namespace AsbCloudWebApi.Controllers return Ok(result); } - private async Task CanUserAccessToWellAsync(int idWell, CancellationToken token = default) + private async Task CanUserAccessToWellAsync(int idWell, CancellationToken token) { int? idCompany = User.GetCompanyId(); return idCompany is not null && await wellService.IsCompanyInvolvedInWellAsync((int)idCompany, diff --git a/AsbCloudWebApi/Controllers/WellController.cs b/AsbCloudWebApi/Controllers/WellController.cs index 627b2f88..db69f959 100644 --- a/AsbCloudWebApi/Controllers/WellController.cs +++ b/AsbCloudWebApi/Controllers/WellController.cs @@ -33,7 +33,7 @@ namespace AsbCloudWebApi.Controllers [HttpGet] [Permission] [ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)] - public async Task GetWellsAsync(CancellationToken token = default) + public async Task GetWellsAsync(CancellationToken token) { var idCompany = User.GetCompanyId(); @@ -53,7 +53,7 @@ namespace AsbCloudWebApi.Controllers /// Список скважин [HttpGet("wellTree")] [ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)] - public async Task GetWellTreeAsync(CancellationToken token = default) + public async Task GetWellTreeAsync(CancellationToken token) { var idCompany = User.GetCompanyId(); @@ -75,7 +75,7 @@ namespace AsbCloudWebApi.Controllers [HttpGet("{idWell}")] [Permission] [ProducesResponseType(typeof(WellDto), (int)System.Net.HttpStatusCode.OK)] - public async Task GetAsync(int idWell, CancellationToken token = default) + public async Task GetAsync(int idWell, CancellationToken token) { var idCompany = User.GetCompanyId(); @@ -100,7 +100,7 @@ namespace AsbCloudWebApi.Controllers [Permission] [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] public async Task UpdateWellAsync(WellDto dto, - CancellationToken token = default) + CancellationToken token) { var idCompany = User.GetCompanyId(); @@ -127,7 +127,7 @@ namespace AsbCloudWebApi.Controllers [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] public async Task UpdateWellStateAsync(int idWell, [Range(0, 2, ErrorMessage = "Статус некорректен")] int idState, - CancellationToken token = default) + CancellationToken token) { var idCompany = User.GetCompanyId(); diff --git a/AsbCloudWebApi/Controllers/WellFinalDocumentsController.cs b/AsbCloudWebApi/Controllers/WellFinalDocumentsController.cs index 8178bed7..19952231 100644 --- a/AsbCloudWebApi/Controllers/WellFinalDocumentsController.cs +++ b/AsbCloudWebApi/Controllers/WellFinalDocumentsController.cs @@ -163,7 +163,7 @@ namespace AsbCloudWebApi.Controllers [HttpGet] [Route("wellCaseCategories")] [Permission] - public async Task GetWellCaseCategoriesAsync(CancellationToken token = default) + public async Task GetWellCaseCategoriesAsync(CancellationToken token) { var data = await fileCategoryService.GetWellCaseCategoriesAsync(token); return Ok(data);