forked from ddrilling/AsbCloudServer
Разделение dto для drill_test на DrillTestBaseDto и DrillTestDto
This commit is contained in:
parent
df8ddf3122
commit
2f1b8ee87b
37
AsbCloudApp/Data/SAUB/DrillTestBaseDto.cs
Normal file
37
AsbCloudApp/Data/SAUB/DrillTestBaseDto.cs
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
namespace AsbCloudApp.Data.SAUB
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// DTO для получения записи drill_test из панели
|
||||||
|
/// </summary>
|
||||||
|
public class DrillTestBaseDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Идентификатор drill test
|
||||||
|
/// </summary>
|
||||||
|
[Required]
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Время начала drill test
|
||||||
|
/// </summary>
|
||||||
|
[Required]
|
||||||
|
public DateTimeOffset TimeStampStart { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Глубина начала drill test
|
||||||
|
/// </summary>
|
||||||
|
[Required]
|
||||||
|
public float DepthStart { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Параметры теста
|
||||||
|
/// </summary>
|
||||||
|
[Required]
|
||||||
|
public IEnumerable<DrillTestParamsDto> Params { get; set; } = Enumerable.Empty<DrillTestParamsDto>();
|
||||||
|
}
|
||||||
|
}
|
@ -1,42 +1,15 @@
|
|||||||
using System;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
namespace AsbCloudApp.Data.SAUB
|
namespace AsbCloudApp.Data.SAUB
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// DTO для описания записи drill_test
|
/// DTO для отображения записи drill_test
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class DrillTestDto
|
public class DrillTestDto : DrillTestBaseDto
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// Идентификатор drill test
|
|
||||||
/// </summary>
|
|
||||||
[Required]
|
|
||||||
public int Id { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Время начала drill test
|
|
||||||
/// </summary>
|
|
||||||
[Required]
|
|
||||||
public DateTimeOffset TimeStampStart { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Глубина начала drill test
|
|
||||||
/// </summary>
|
|
||||||
[Required]
|
|
||||||
public float DepthStart { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Связанная с drill_test телеметрия
|
/// Связанная с drill_test телеметрия
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public TelemetryDto? Telemetry { get; set; }
|
public TelemetryDto? Telemetry { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Параметры теста
|
|
||||||
/// </summary>
|
|
||||||
[Required]
|
|
||||||
public IEnumerable<DrillTestParamsDto> Params { get; set; } = Enumerable.Empty<DrillTestParamsDto>();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,6 @@ namespace AsbCloudApp.Repositories
|
|||||||
/// <param name="dto">запись drill test</param>
|
/// <param name="dto">запись drill test</param>
|
||||||
/// <param name="token"></param>
|
/// <param name="token"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<int> SaveDataAsync(int idTelemetry, DrillTestDto dto, CancellationToken token);
|
Task<int> SaveDataAsync(int idTelemetry, DrillTestBaseDto dto, CancellationToken token);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,7 @@ namespace AsbCloudInfrastructure.Repository
|
|||||||
return dto;
|
return dto;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<int> SaveDataAsync(int idTelemetry, DrillTestDto dto, CancellationToken token)
|
public async Task<int> SaveDataAsync(int idTelemetry, DrillTestBaseDto dto, CancellationToken token)
|
||||||
{
|
{
|
||||||
var entity = dto.Adapt<DrillTest>();
|
var entity = dto.Adapt<DrillTest>();
|
||||||
entity.IdTelemetry = idTelemetry;
|
entity.IdTelemetry = idTelemetry;
|
||||||
|
@ -58,7 +58,7 @@ public class DrillTestController : ControllerBase
|
|||||||
[HttpPost("api/telemetry/{uid}/[controller]")]
|
[HttpPost("api/telemetry/{uid}/[controller]")]
|
||||||
public async Task<IActionResult> PostDataAsync(
|
public async Task<IActionResult> PostDataAsync(
|
||||||
string uid,
|
string uid,
|
||||||
[FromBody] DrillTestDto dto,
|
[FromBody] DrillTestBaseDto dto,
|
||||||
CancellationToken token)
|
CancellationToken token)
|
||||||
{
|
{
|
||||||
var telemetry = telemetryService.GetOrCreateTelemetryByUid(uid);
|
var telemetry = telemetryService.GetOrCreateTelemetryByUid(uid);
|
||||||
@ -85,7 +85,6 @@ public class DrillTestController : ControllerBase
|
|||||||
/// <param name="cancellationToken"></param>
|
/// <param name="cancellationToken"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet("api/well/{idWell}/[controller]")]
|
[HttpGet("api/well/{idWell}/[controller]")]
|
||||||
[Permission]
|
|
||||||
[ProducesResponseType(typeof(PhysicalFileResult), (int)HttpStatusCode.OK, "application/octet-stream")]
|
[ProducesResponseType(typeof(PhysicalFileResult), (int)HttpStatusCode.OK, "application/octet-stream")]
|
||||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||||
public async Task<IActionResult> GenerateReportAsync([FromRoute] int idWell,
|
public async Task<IActionResult> GenerateReportAsync([FromRoute] int idWell,
|
||||||
@ -108,7 +107,6 @@ public class DrillTestController : ControllerBase
|
|||||||
/// <param name="cancellationToken"></param>
|
/// <param name="cancellationToken"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet("api/well/{idWell}/[controller]/all")]
|
[HttpGet("api/well/{idWell}/[controller]/all")]
|
||||||
[Permission]
|
|
||||||
[ProducesResponseType(typeof(PaginationContainer<DrillTestReportInfoDto>), (int)HttpStatusCode.OK)]
|
[ProducesResponseType(typeof(PaginationContainer<DrillTestReportInfoDto>), (int)HttpStatusCode.OK)]
|
||||||
public async Task<IActionResult> GetListAsync([FromRoute][Required] int idWell,
|
public async Task<IActionResult> GetListAsync([FromRoute][Required] int idWell,
|
||||||
[FromQuery] FileReportRequest request,
|
[FromQuery] FileReportRequest request,
|
||||||
|
@ -20,7 +20,7 @@ namespace AsbCloudWebApi.SignalR.Clients
|
|||||||
/// <param name="dto"></param>
|
/// <param name="dto"></param>
|
||||||
/// <param name="token"></param>
|
/// <param name="token"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task ReceiveDrilltestData(DrillTestDto dto, CancellationToken token);
|
Task ReceiveDrilltestData(DrillTestBaseDto dto, CancellationToken token);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Обновление записей РТК
|
/// Обновление записей РТК
|
||||||
|
Loading…
Reference in New Issue
Block a user