diff --git a/AsbCloudInfrastructure/Services/WellboreService.cs b/AsbCloudInfrastructure/Services/WellboreService.cs index a0073128..4417dd49 100644 --- a/AsbCloudInfrastructure/Services/WellboreService.cs +++ b/AsbCloudInfrastructure/Services/WellboreService.cs @@ -36,6 +36,7 @@ public class WellboreService : IWellboreService var rowSections = await wellOperationRepository.GetSectionsAsync(idsWells, token); var groupedSections = rowSections + .Where(section => section.IdType == 1) .GroupBy(s => s.IdWell); var wellbores = wells diff --git a/AsbCloudWebApi.Tests/ServicesTests/WellboreServiceTest.cs b/AsbCloudWebApi.Tests/ServicesTests/WellboreServiceTest.cs index 985a7e6f..1a802054 100644 --- a/AsbCloudWebApi.Tests/ServicesTests/WellboreServiceTest.cs +++ b/AsbCloudWebApi.Tests/ServicesTests/WellboreServiceTest.cs @@ -106,9 +106,11 @@ namespace AsbCloudWebApi.Tests.ServicesTests { IdWell = well1.Id, IdWellSectionType = 0, IdType = 1, DateStart = new DateTime(2023, 01, 03), DateEnd = new DateTime(2023, 01, 04), DepthStart = 200, DepthEnd = 210 }; var section3 = new SectionByOperationsDto() { IdWell = int.MaxValue, IdWellSectionType = 0, IdType = 1, DateStart = new DateTime(2023, 01, 03), DateEnd = new DateTime(2023, 01, 04), DepthStart = 200, DepthEnd = 220 }; + var section4 = new SectionByOperationsDto() + { IdWell = well1.Id, IdWellSectionType = 0, IdType = 0, DateStart = new DateTime(2023, 01, 05), DateEnd = new DateTime(2023, 01, 06), DepthStart = 150, DepthEnd = 220 }; wellOperationRepository.GetSectionsAsync(Arg.Any>(), Arg.Any()) - .Returns(new SectionByOperationsDto[]{section0, section1, section2, section3 }); + .Returns(new SectionByOperationsDto[]{section0, section1, section2, section3, section4, }); var result = await wellboreService.GetWellboresAsync(new[] { 1 }, CancellationToken.None); diff --git a/AsbCloudWebApi/Rest/Auth.http b/AsbCloudWebApi/Rest/Auth.http new file mode 100644 index 00000000..36097c0e --- /dev/null +++ b/AsbCloudWebApi/Rest/Auth.http @@ -0,0 +1,12 @@ +@baseUrl = http://127.0.0.1:5000 +@contentType = application/json + +## Auth +POST {{baseUrl}}/auth/login +Content-Type: {{contentType}} +accept: */* + +{ + "login": "dev", + "password": "Rp7gsNMk" +} \ No newline at end of file diff --git a/AsbCloudWebApi/Rest/wellbore.http b/AsbCloudWebApi/Rest/wellbore.http index 9a7918ac..e00c6687 100644 --- a/AsbCloudWebApi/Rest/wellbore.http +++ b/AsbCloudWebApi/Rest/wellbore.http @@ -1,15 +1,13 @@ @baseUrl = http://127.0.0.1:5000 @contentType = application/json -@auth = Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImN0eSI6IkpXVCJ9.eyJpZCI6IjEiLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiZGV2IiwiaWRDb21wYW55IjoiMSIsImh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vd3MvMjAwOC8wNi9pZGVudGl0eS9jbGFpbXMvcm9sZSI6InJvb3QiLCJuYmYiOjE2NjI1NDgxNjIsImV4cCI6MTY5NDEwNTc2MiwiaXNzIjoiYSIsImF1ZCI6ImEifQ.OEAlNzxi7Jat6pzDBTAjTbChskc-tdJthJexyWwwUKE +@auth = Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjEiLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiZGV2IiwiaWRDb21wYW55IjoiMSIsImh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vd3MvMjAwOC8wNi9pZGVudGl0eS9jbGFpbXMvcm9sZSI6InJvb3QiLCJuYmYiOjE2OTgxMjY1MTUsImV4cCI6MTcyOTY4NDExNSwiaXNzIjoiYSIsImF1ZCI6ImEifQ.3Lq256cYtHnKlGWChPhZv2rUJPjbJEHU-18xdyJlYDE -@uid = 20210101_000000000 -@idCluster = 1 -@idWell = 1 +@idWell = 2 # https://marketplace.visualstudio.com/items?itemName=humao.rest-client ### -GET {{baseUrl}}/api/well/wellbore?ids=1,2 +GET {{baseUrl}}/api/wellbore?idsWells=1 Content-Type: {{contentType}} accept: */* Authorization: {{auth}}