diff --git a/AsbCloudApp/Services/IWellSectionService.cs b/AsbCloudApp/Services/IWellSectionService.cs index fa22c6bb..f1cce60b 100644 --- a/AsbCloudApp/Services/IWellSectionService.cs +++ b/AsbCloudApp/Services/IWellSectionService.cs @@ -6,15 +6,10 @@ namespace AsbCloudApp.Services { public interface IWellSectionService { - Task GetTypesAsync(CancellationToken token); Task> GetAggregatedWellByWellIdAsync(int idWell, int skip, int take, CancellationToken token); Task> GetSectionsByWellIdAsync(int idWell, int skip = 0, int take = 32, CancellationToken token = default); Task GetSectionByWellIdAsync(int id, CancellationToken token = default); - //Task InsertAsync(WellSectionDto newItem, int idWell, CancellationToken token = default); - //Task> InsertRangeAsync(int idWell, IEnumerable newItems, CancellationToken token = default); - //Task UpdateAsync(int idWell, int idSection, WellSectionDto item, CancellationToken token = default); - //Task DeleteAsync(IEnumerable ids, CancellationToken token = default); } } diff --git a/AsbCloudInfrastructure/Services/WellSectionService.cs b/AsbCloudInfrastructure/Services/WellSectionService.cs index 1ae287c7..bca4afce 100644 --- a/AsbCloudInfrastructure/Services/WellSectionService.cs +++ b/AsbCloudInfrastructure/Services/WellSectionService.cs @@ -23,9 +23,6 @@ namespace AsbCloudInfrastructure.Services cachedSectionsTypes = cache.GetCachedTable((DbContext)db); } - public Task GetTypesAsync(CancellationToken token) => - db.WellSectionTypes.Select(e => e.Caption).Distinct().AsNoTracking().ToArrayAsync(token); - public async Task> GetAggregatedWellByWellIdAsync(int idWell, int skip, int take, CancellationToken token) { @@ -160,6 +157,7 @@ namespace AsbCloudInfrastructure.Services dto.SectionType = entity.WellSectionType.Caption; return dto; } + private static PaginationContainer PaginateData(IEnumerable> groupedCollection, int skip, int take) { diff --git a/AsbCloudWebApi/Controllers/FileController.cs b/AsbCloudWebApi/Controllers/FileController.cs index e5519ba9..635c35de 100644 --- a/AsbCloudWebApi/Controllers/FileController.cs +++ b/AsbCloudWebApi/Controllers/FileController.cs @@ -150,7 +150,7 @@ namespace AsbCloudWebApi.Controllers } /// - /// Удаляет файл с диска на сервере + /// Помечает файл как удаленный /// /// id скважины /// id запрашиваемого файла diff --git a/AsbCloudWebApi/Controllers/WellSectionController.cs b/AsbCloudWebApi/Controllers/WellSectionController.cs index c38ca2c8..2d8e362d 100644 --- a/AsbCloudWebApi/Controllers/WellSectionController.cs +++ b/AsbCloudWebApi/Controllers/WellSectionController.cs @@ -24,15 +24,6 @@ namespace AsbCloudWebApi.Controllers this.wellService = wellService; } - [HttpGet] - [Route("types")] - [ProducesResponseType(typeof(string[]), (int)System.Net.HttpStatusCode.OK)] - public async Task GetTypesAsync(CancellationToken token = default) - { - var result = await sectionsService.GetTypesAsync(token).ConfigureAwait(false); - return Ok(result); - } - [HttpGet] [Route("aggregated")] [ProducesResponseType(typeof(PaginationContainer), (int)System.Net.HttpStatusCode.OK)] @@ -74,41 +65,6 @@ namespace AsbCloudWebApi.Controllers return Ok(result); } - //[HttpPost] - //[ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)] - //public async Task InsertAsync(int idWell, [FromBody] IEnumerable values, - // CancellationToken token = default) - //{ - // if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) - // return Forbid(); - - // var result = await sectionsService.InsertRangeAsync(idWell, values, token).ConfigureAwait(false); - // return Ok(result); - //} - - //[HttpPut("{idSection}")] - //[ProducesResponseType(typeof(WellSectionDto), (int)System.Net.HttpStatusCode.OK)] - //public async Task UpdateAsync(int idWell, int idSection, [FromBody] WellSectionDto value, CancellationToken token = default) - //{ - // if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false)) - // return Forbid(); - - // var result = await sectionsService.UpdateAsync(idWell, idSection, value, token).ConfigureAwait(false); - // return Ok(result); - //} - - //[HttpDelete("{idSection}")] - //[ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] - //public async Task DeleteAsync(int idWell, int idItem, CancellationToken token = default) - //{ - // if (!await CanUserAccessToWellAsync(idWell, - // token).ConfigureAwait(false)) - // return Forbid(); - - // var result = await sectionsService.DeleteAsync(new int[] { idItem }, token).ConfigureAwait(false); - // return Ok(result); - //} - private async Task CanUserAccessToWellAsync(int idWell, CancellationToken token = default) { int? idCompany = User.GetCompanyId();