From fee782f08f8d14e0381a04d629552d0ddf65f3e0 Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Mon, 23 Oct 2023 14:15:48 +0500 Subject: [PATCH] =?UTF-8?q?=D0=A2=D0=B5=D1=81=D1=82=20DrillTest.http=20+?= =?UTF-8?q?=20=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B0=20DrillTestDto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AsbCloudApp/Data/SAUB/DrillTestDto.cs | 2 +- .../Repository/DrillTestRepository.cs | 6 +-- AsbCloudWebApi/Rest/DrillTest.http | 45 +++++++++++++++++++ 3 files changed, 48 insertions(+), 5 deletions(-) create mode 100644 AsbCloudWebApi/Rest/DrillTest.http diff --git a/AsbCloudApp/Data/SAUB/DrillTestDto.cs b/AsbCloudApp/Data/SAUB/DrillTestDto.cs index acd8ccc6..03f344c2 100644 --- a/AsbCloudApp/Data/SAUB/DrillTestDto.cs +++ b/AsbCloudApp/Data/SAUB/DrillTestDto.cs @@ -27,7 +27,7 @@ namespace AsbCloudApp.Data.SAUB /// /// Связанная с drill_test телеметрия /// - public TelemetryDto Telemetry { get; set; } = null!; + public TelemetryDto? Telemetry { get; set; } /// /// Параметры теста diff --git a/AsbCloudInfrastructure/Repository/DrillTestRepository.cs b/AsbCloudInfrastructure/Repository/DrillTestRepository.cs index 427556a2..4ab892a3 100644 --- a/AsbCloudInfrastructure/Repository/DrillTestRepository.cs +++ b/AsbCloudInfrastructure/Repository/DrillTestRepository.cs @@ -17,12 +17,10 @@ namespace AsbCloudInfrastructure.Repository public class DrillTestRepository : IDrillTestRepository { private readonly IAsbCloudDbContext db; - private readonly IWellService wellService; - public DrillTestRepository(IAsbCloudDbContext db, IWellService wellService) + public DrillTestRepository(IAsbCloudDbContext db) { this.db = db; - this.wellService = wellService; } public async Task> GetAllAsync(int idTelemetry, FileReportRequest request, CancellationToken cancellationToken) @@ -61,7 +59,7 @@ namespace AsbCloudInfrastructure.Repository throw new ArgumentInvalidException(new string[] { nameof(id), nameof(idTelemetry) }, $"Drill test with id: {id} and idTelemetry: {idTelemetry} does not exist."); var dto = drillTest.Adapt(); - dto.TimeStampStart = dto.TimeStampStart.ToRemoteDateTime(dto.Telemetry.TimeZone?.Hours ?? 0); + dto.TimeStampStart = dto.TimeStampStart.ToRemoteDateTime(dto.Telemetry?.TimeZone?.Hours ?? 0); return dto; } diff --git a/AsbCloudWebApi/Rest/DrillTest.http b/AsbCloudWebApi/Rest/DrillTest.http new file mode 100644 index 00000000..47d7db66 --- /dev/null +++ b/AsbCloudWebApi/Rest/DrillTest.http @@ -0,0 +1,45 @@ +@baseUrl = http://127.0.0.1:5000 +@contentType = application/json +@contentTypeForFiles = application/octet-stream +@auth = Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjEiLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiZGV2IiwiaWRDb21wYW55IjoiMSIsImh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vd3MvMjAwOC8wNi9pZGVudGl0eS9jbGFpbXMvcm9sZSI6InJvb3QiLCJuYmYiOjE2OTc0MzcwMzEsImV4cCI6MTcyODk5NDYzMSwiaXNzIjoiYSIsImF1ZCI6ImEifQ.vB7Qb3K9gG77iP8y25zB3RcZIQk9cHkq3I1SkcooYJs + +@uid = 20210101_000000000 +@id = 1 +@idWell = 55 + +### drill test +POST {{baseUrl}}/api/telemetry/{{uid}}/DrillTest +Content-Type: {{contentType}} +accept: */* + +{ + "id": @id, + "timeStampStart": "2023-10-23T08:55:36.882Z", + "depthStart": 10, + "params": [ + { + "step": 1, + "workload": 2, + "speed": 3, + "depthSpeed": 4, + "timeDrillStep": 5, + "depthDrillStep": 15 + } + ] +} + + +### drill test +GET {{baseUrl}}/api/well/{{idWell}}/DrillTest/all +Content-Type: {{contentType}} +accept: */* +Authorization: {{auth}} + +### drill test +GET {{baseUrl}}/api/well/{{idWell}}/DrillTest?id={{id}} +Content-Type: {{contentTypeForFiles}} +accept: */* +Authorization: {{auth}} + + +