Фикс РТК

1. Поправлены комментарии
2. Добавлен атрибут [AllowAnonymous] для метода получения РТК по телеметрии
This commit is contained in:
Степанов Дмитрий 2023-10-19 10:31:28 +05:00
parent f8d2131c27
commit 84cd0ec3fa
3 changed files with 33 additions and 28 deletions

View File

@ -27,27 +27,10 @@ public abstract class ProcessMapBaseController<T> : ControllerBase
{
private readonly IHubContext<TelemetryHub> telemetryHubContext;
private readonly ITelemetryService telemetryService;
public abstract string SignalRMethod { get; }
protected int IdUser
{
get
{
var idUser = User.GetUserId();
if (!idUser.HasValue)
throw new ForbidException("Неизвестный пользователь");
return idUser.Value;
}
}
private readonly IWellService wellService;
private readonly IUserRepository userRepository;
private readonly ICrudRepository<WellSectionTypeDto> wellSectionRepository;
protected readonly IProcessMapPlanRepository<T> repository;
private readonly IProcessMapPlanRepository<T> repository;
protected ProcessMapBaseController(IWellService wellService,
IProcessMapPlanRepository<T> repository,
@ -64,6 +47,21 @@ public abstract class ProcessMapBaseController<T> : ControllerBase
this.telemetryService = telemetryService;
}
public abstract string SignalRMethod { get; }
protected int IdUser
{
get
{
var idUser = User.GetUserId();
if (!idUser.HasValue)
throw new ForbidException("Неизвестный пользователь");
return idUser.Value;
}
}
/// <summary>
/// Создание плановой РТК
/// </summary>
@ -163,6 +161,7 @@ public abstract class ProcessMapBaseController<T> : ControllerBase
/// <param name="cancellationToken"></param>
/// <returns></returns>
[HttpGet("/api/telemetry/{uid}/[controller]")]
[AllowAnonymous]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)]
public async Task<ActionResult<IEnumerable<T>>> GetProcessMapPlanByTelemetry(string uid, DateTime updateFrom, CancellationToken cancellationToken)

View File

@ -16,6 +16,9 @@ using Microsoft.AspNetCore.SignalR;
namespace AsbCloudWebApi.Controllers.ProcessMaps;
/// <summary>
/// РТК бурение
/// </summary>
public class ProcessMapWellDrillingController : ProcessMapBaseController<ProcessMapPlanWellDrillingDto>
{
private readonly IProcessMapReportWellDrillingService processMapReportWellDrillingService;
@ -41,7 +44,7 @@ public class ProcessMapWellDrillingController : ProcessMapBaseController<Process
}
/// <summary>
/// Получение отчета РТК бурение
/// Получение данных для отчета РТК бурение
/// </summary>
/// <param name="idWell">Id</param>
/// <param name="cancellationToken"></param>
@ -75,7 +78,7 @@ public class ProcessMapWellDrillingController : ProcessMapBaseController<Process
}
/// <summary>
/// Импорт РТК бурение
/// Импорт РТК бурение план
/// </summary>
/// <param name="idWell">Id скважины</param>
/// <param name="options"></param>
@ -115,7 +118,7 @@ public class ProcessMapWellDrillingController : ProcessMapBaseController<Process
}
/// <summary>
/// Экспорт РТК бурение
/// Экспорт РТК бурение план
/// </summary>
/// <param name="idWell">Id скважины</param>
/// <param name="cancellationToken"></param>

View File

@ -7,6 +7,9 @@ using Microsoft.AspNetCore.SignalR;
namespace AsbCloudWebApi.Controllers.ProcessMaps;
/// <summary>
/// РТК проработки скважины
/// </summary>
public class ProcessMapWellReamController : ProcessMapBaseController<ProcessMapPlanWellReamDto>
{
public ProcessMapWellReamController(IWellService wellService,