diff --git a/PARR.API/Contracts/V1/ApiRoutes.cs b/PARR.API/Contracts/V1/ApiRoutes.cs index 76303811..a142816c 100644 --- a/PARR.API/Contracts/V1/ApiRoutes.cs +++ b/PARR.API/Contracts/V1/ApiRoutes.cs @@ -56,6 +56,7 @@ { public const string GetAll = Base + "/templates/"; public const string Get = Base + "/templates/" + getParam; + public const string ChangeState = Base + "/templates/" + getParam + "/change-state"; //public const string SetOkStatus = Base + "/templates/" + getParam + "/status/ok"; //public const string GetByStatusCode = Base + "/templates/status/{statusCode}"; diff --git a/PARR.API/Contracts/V1/Requests/TemplateChangeStateRequest.cs b/PARR.API/Contracts/V1/Requests/TemplateChangeStateRequest.cs new file mode 100644 index 00000000..121695af --- /dev/null +++ b/PARR.API/Contracts/V1/Requests/TemplateChangeStateRequest.cs @@ -0,0 +1,15 @@ +namespace PARR.API.Contracts.V1.Requests +{ + public class TemplateChangeStateRequest + { + /// + /// Активировать шаблон + /// + public bool IsActiveTemplate { get; set; } + + /// + /// Активировать расписание + /// + public bool IsActiveSchedule { get; set; } + } +} diff --git a/PARR.API/Controllers/V1/TemplateController.cs b/PARR.API/Controllers/V1/TemplateController.cs index 7e49b66b..94a4a38a 100644 --- a/PARR.API/Controllers/V1/TemplateController.cs +++ b/PARR.API/Controllers/V1/TemplateController.cs @@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using PARR.API.Contracts.V1; +using PARR.API.Contracts.V1.Requests; using PARR.API.Contracts.V1.Requests.Queries; using PARR.API.Contracts.V1.Responses; using PARR.API.Contracts.V1.Responses.Base; @@ -20,16 +21,19 @@ namespace PARR.API.Controllers.V1 private readonly IMapper mapper; private readonly ITemplateService templateService; private readonly SettingsFromDb settingsFromDb; + private readonly IRobotConfigurationService robotConfigurationService; public TemplateController( IMapper mapper, ITemplateService templateService, - SettingsFromDb settingsFromDb + SettingsFromDb settingsFromDb, + IRobotConfigurationService robotConfigurationService ) { this.mapper = mapper; this.templateService = templateService; this.settingsFromDb = settingsFromDb; + this.robotConfigurationService = robotConfigurationService; } @@ -44,7 +48,7 @@ namespace PARR.API.Controllers.V1 var paginationFilter = mapper.Map(paginationQuery); IQueryable