forked from ddrilling/AsbCloudServer
fix WellboreService; плановые секции не учитываются.
WellboreServiceTest Add testCase; Add Auth.http; Fix wellbore.http;
This commit is contained in:
parent
18b2647889
commit
399393fd55
@ -36,6 +36,7 @@ public class WellboreService : IWellboreService
|
|||||||
|
|
||||||
var rowSections = await wellOperationRepository.GetSectionsAsync(idsWells, token);
|
var rowSections = await wellOperationRepository.GetSectionsAsync(idsWells, token);
|
||||||
var groupedSections = rowSections
|
var groupedSections = rowSections
|
||||||
|
.Where(section => section.IdType == 1)
|
||||||
.GroupBy(s => s.IdWell);
|
.GroupBy(s => s.IdWell);
|
||||||
|
|
||||||
var wellbores = wells
|
var wellbores = wells
|
||||||
|
@ -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 };
|
{ 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()
|
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 };
|
{ 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>())
|
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);
|
var result = await wellboreService.GetWellboresAsync(new[] { 1 }, CancellationToken.None);
|
||||||
|
|
||||||
|
12
AsbCloudWebApi/Rest/Auth.http
Normal file
12
AsbCloudWebApi/Rest/Auth.http
Normal 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"
|
||||||
|
}
|
@ -1,15 +1,13 @@
|
|||||||
@baseUrl = http://127.0.0.1:5000
|
@baseUrl = http://127.0.0.1:5000
|
||||||
@contentType = application/json
|
@contentType = application/json
|
||||||
@auth = Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImN0eSI6IkpXVCJ9.eyJpZCI6IjEiLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiZGV2IiwiaWRDb21wYW55IjoiMSIsImh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vd3MvMjAwOC8wNi9pZGVudGl0eS9jbGFpbXMvcm9sZSI6InJvb3QiLCJuYmYiOjE2NjI1NDgxNjIsImV4cCI6MTY5NDEwNTc2MiwiaXNzIjoiYSIsImF1ZCI6ImEifQ.OEAlNzxi7Jat6pzDBTAjTbChskc-tdJthJexyWwwUKE
|
@auth = Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjEiLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiZGV2IiwiaWRDb21wYW55IjoiMSIsImh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vd3MvMjAwOC8wNi9pZGVudGl0eS9jbGFpbXMvcm9sZSI6InJvb3QiLCJuYmYiOjE2OTgxMjY1MTUsImV4cCI6MTcyOTY4NDExNSwiaXNzIjoiYSIsImF1ZCI6ImEifQ.3Lq256cYtHnKlGWChPhZv2rUJPjbJEHU-18xdyJlYDE
|
||||||
|
|
||||||
@uid = 20210101_000000000
|
@idWell = 2
|
||||||
@idCluster = 1
|
|
||||||
@idWell = 1
|
|
||||||
|
|
||||||
# https://marketplace.visualstudio.com/items?itemName=humao.rest-client
|
# 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}}
|
Content-Type: {{contentType}}
|
||||||
accept: */*
|
accept: */*
|
||||||
Authorization: {{auth}}
|
Authorization: {{auth}}
|
||||||
|
Loading…
Reference in New Issue
Block a user