diff --git a/AsbCloudApp/Data/SAUB/DrillTestBaseDto.cs b/AsbCloudApp/Data/SAUB/DrillTestBaseDto.cs new file mode 100644 index 00000000..6e9f56bf --- /dev/null +++ b/AsbCloudApp/Data/SAUB/DrillTestBaseDto.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; + +namespace AsbCloudApp.Data.SAUB +{ + /// + /// DTO для получения записи drill_test из панели + /// + public class DrillTestBaseDto + { + /// + /// Идентификатор drill test + /// + [Required] + public int Id { get; set; } + + /// + /// Время начала drill test + /// + [Required] + public DateTimeOffset TimeStampStart { get; set; } + + /// + /// Глубина начала drill test + /// + [Required] + public float DepthStart { get; set; } + + /// + /// Параметры теста + /// + [Required] + public IEnumerable Params { get; set; } = Enumerable.Empty(); + } +} diff --git a/AsbCloudApp/Data/SAUB/DrillTestDto.cs b/AsbCloudApp/Data/SAUB/DrillTestDto.cs index 05e0aa09..0af9cb9c 100644 --- a/AsbCloudApp/Data/SAUB/DrillTestDto.cs +++ b/AsbCloudApp/Data/SAUB/DrillTestDto.cs @@ -1,42 +1,15 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; +using System.ComponentModel.DataAnnotations; namespace AsbCloudApp.Data.SAUB { /// - /// DTO для описания записи drill_test + /// DTO для отображения записи drill_test /// - public class DrillTestDto + public class DrillTestDto : DrillTestBaseDto { - /// - /// Идентификатор drill test - /// - [Required] - public int Id { get; set; } - - /// - /// Время начала drill test - /// - [Required] - public DateTimeOffset TimeStampStart { get; set; } - - /// - /// Глубина начала drill test - /// - [Required] - public float DepthStart { get; set; } - /// /// Связанная с drill_test телеметрия /// public TelemetryDto? Telemetry { get; set; } - - /// - /// Параметры теста - /// - [Required] - public IEnumerable Params { get; set; } = Enumerable.Empty(); } } diff --git a/AsbCloudApp/Repositories/IDrillTestRepository.cs b/AsbCloudApp/Repositories/IDrillTestRepository.cs index 9c7a2f50..22f11a06 100644 --- a/AsbCloudApp/Repositories/IDrillTestRepository.cs +++ b/AsbCloudApp/Repositories/IDrillTestRepository.cs @@ -36,6 +36,6 @@ namespace AsbCloudApp.Repositories /// запись drill test /// /// - Task SaveDataAsync(int idTelemetry, DrillTestDto dto, CancellationToken token); + Task SaveDataAsync(int idTelemetry, DrillTestBaseDto dto, CancellationToken token); } } diff --git a/AsbCloudInfrastructure/Repository/DrillTestRepository.cs b/AsbCloudInfrastructure/Repository/DrillTestRepository.cs index f5fb4ece..d8700929 100644 --- a/AsbCloudInfrastructure/Repository/DrillTestRepository.cs +++ b/AsbCloudInfrastructure/Repository/DrillTestRepository.cs @@ -63,7 +63,7 @@ namespace AsbCloudInfrastructure.Repository return dto; } - public async Task SaveDataAsync(int idTelemetry, DrillTestDto dto, CancellationToken token) + public async Task SaveDataAsync(int idTelemetry, DrillTestBaseDto dto, CancellationToken token) { var entity = dto.Adapt(); entity.IdTelemetry = idTelemetry; diff --git a/AsbCloudWebApi/Controllers/DrillTestController.cs b/AsbCloudWebApi/Controllers/DrillTestController.cs index 2d9585dc..8562e54c 100644 --- a/AsbCloudWebApi/Controllers/DrillTestController.cs +++ b/AsbCloudWebApi/Controllers/DrillTestController.cs @@ -58,7 +58,7 @@ public class DrillTestController : ControllerBase [HttpPost("api/telemetry/{uid}/[controller]")] public async Task PostDataAsync( string uid, - [FromBody] DrillTestDto dto, + [FromBody] DrillTestBaseDto dto, CancellationToken token) { var telemetry = telemetryService.GetOrCreateTelemetryByUid(uid); @@ -85,7 +85,6 @@ public class DrillTestController : ControllerBase /// /// [HttpGet("api/well/{idWell}/[controller]")] - [Permission] [ProducesResponseType(typeof(PhysicalFileResult), (int)HttpStatusCode.OK, "application/octet-stream")] [ProducesResponseType(StatusCodes.Status204NoContent)] public async Task GenerateReportAsync([FromRoute] int idWell, @@ -108,7 +107,6 @@ public class DrillTestController : ControllerBase /// /// [HttpGet("api/well/{idWell}/[controller]/all")] - [Permission] [ProducesResponseType(typeof(PaginationContainer), (int)HttpStatusCode.OK)] public async Task GetListAsync([FromRoute][Required] int idWell, [FromQuery] FileReportRequest request, diff --git a/AsbCloudWebApi/SignalR/Clients/ITelemetryHubClient.cs b/AsbCloudWebApi/SignalR/Clients/ITelemetryHubClient.cs index 251b1a61..2e831d1e 100644 --- a/AsbCloudWebApi/SignalR/Clients/ITelemetryHubClient.cs +++ b/AsbCloudWebApi/SignalR/Clients/ITelemetryHubClient.cs @@ -20,7 +20,7 @@ namespace AsbCloudWebApi.SignalR.Clients /// /// /// - Task ReceiveDrilltestData(DrillTestDto dto, CancellationToken token); + Task ReceiveDrilltestData(DrillTestBaseDto dto, CancellationToken token); /// /// Обновление записей РТК