fix WellboreService; плановые секции не учитываются.

WellboreServiceTest Add testCase;
Add Auth.http;
Fix wellbore.http;
This commit is contained in:
ngfrolov 2023-10-24 11:15:27 +05:00
parent 18b2647889
commit 399393fd55
Signed by untrusted user who does not match committer: ng.frolov
GPG Key ID: E99907A0357B29A7
4 changed files with 19 additions and 6 deletions

View File

@ -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

View File

@ -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<IEnumerable<int>>(), Arg.Any<CancellationToken>())
.Returns(new SectionByOperationsDto[]{section0, section1, section2, section3 });
.Returns(new SectionByOperationsDto[]{section0, section1, section2, section3, section4, });
var result = await wellboreService.GetWellboresAsync(new[] { 1 }, CancellationToken.None);

View File

@ -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"
}

View File

@ -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}}