using AutoMapper;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using PARR.API.Contracts.V1;
using PARR.API.Contracts.V1.Requests.Queries;
using PARR.API.Controllers.V1.Base;
using PARR.API.Services.Interfaces;
using PARR.Core.Repositories.Interfaces;
using PARR.Core.Services.NextRunServices;
using PARR.Core.Services.RobotTask.Interfaces;
using PARR.Core.Services.Shortcodes;
using PARR.Domain.Common.Roles;
using PARR.Domain.Enums;
using PARR.Domain.Settings;
namespace PARR.API.Controllers.V1
{
///
/// Формирование заданий роботам
///
[Authorize(Roles = ParrRoles.EsppRobot.RoleOrAdmin)]
public class RobotTaskController : BaseApiController
{
private readonly IMapper mapper;
private readonly SettingsFromDb settingsFromDb;
private readonly IRobotConfigurationRepository robotConfigurationService;
private readonly ILogger logger;
private readonly IClientService clientService;
private readonly IRobotHistoryRepository robotHistoryService;
private readonly IShortcodesService shortcodesService;
private readonly INextRunService nextRunService;
private readonly IRobotTaskService robotTaskService;
public RobotTaskController(
IMapper mapper,
SettingsFromDb settingsFromDb,
IRobotConfigurationRepository robotConfigurationService,
ILogger logger,
IClientService clientService,
IRobotHistoryRepository robotHistoryService,
IShortcodesService shortcodesService,
INextRunService nextRunService,
IRobotTaskService robotTaskService
)
{
this.mapper = mapper;
this.settingsFromDb = settingsFromDb;
this.robotConfigurationService = robotConfigurationService;
this.logger = logger;
this.clientService = clientService;
this.robotHistoryService = robotHistoryService;
this.shortcodesService = shortcodesService;
this.nextRunService = nextRunService;
this.robotTaskService = robotTaskService;
}
///
/// Получить задание для робота по коду робота и статусу задания
///
/// Код робота
/// Статус задания
/// Параметры
///
[HttpGet(ApiRoutes.RobotTask.GetByRobotAndStatusTask)]
public async Task GetByRobotAndStatusTask([FromRoute] RobotsEnum robotCode, [FromRoute] TaskStatusEnum taskStatusCode, [FromQuery] RobotTaskQuery requestQuery)
{
//robotTaskService
return Ok();
}
}
}