using AsbCloudApp.Data; using AsbCloudApp.Services; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using System; using System.Threading; using System.Threading.Tasks; namespace AsbCloudWebApi.Controllers { [Route("api/schedule")] [ApiController] [Authorize] public class ScheduleController : CrudController { private readonly IScheduleService scheduleService; public ScheduleController(IScheduleService scheduleService) :base(scheduleService) { this.scheduleService = service; } /// /// Получить бурильщика работавшего на скважине в определенное время. /// /// Идентификатор скважины /// Рабочее время /// /// бурильщик [HttpGet("driller")] public async Task> GetDrillerAsync(int idWell, DateTime workTime, CancellationToken token = default) { var result = await scheduleService.GetDrillerAsync(idWell,workTime, token); return Ok(result); } } }