From f69be40ad33b13e15ad6627b98476ec4fabff6d2 Mon Sep 17 00:00:00 2001 From: Mikhail Trubnikov Date: Fri, 13 Oct 2023 14:21:49 +1000 Subject: [PATCH] =?UTF-8?q?feat(api):=20=D0=98=D0=B7=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=81=D0=BE=D1=81=D1=82=D0=BE=D1=8F?= =?UTF-8?q?=D0=BD=D0=B8=D1=8F=20=D1=83=20=D1=88=D0=B0=D0=B1=D0=BB=D0=BE?= =?UTF-8?q?=D0=BD=D0=B0/=D1=80=D0=B0=D1=81=D0=BF=D0=B8=D1=81=D0=B0=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20(=D0=B0=D0=BA=D0=B8=D0=B2=D0=B8=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD=D0=BE/=D0=B4=D0=B5=D0=B0=D0=BA=D1=82=D0=B8?= =?UTF-8?q?=D0=B2=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=BE)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PARR.API/Contracts/V1/ApiRoutes.cs | 1 + .../V1/Requests/TemplateChangeStateRequest.cs | 15 ++++ PARR.API/Controllers/V1/TemplateController.cs | 58 +++++++++++++++- .../DomainToResponseProfile.cs | 1 + PARR.BLL/Helpers/EsppScheduleHelpers.cs | 10 +++ PARR.DAL/Contracts/TaskStatusEnum.cs | 3 + .../Migrations/DataContextModelSnapshot.cs | 68 +++++++++---------- PARR.DAL/Models/ApplicationsInWork.cs | 19 +++++- PARR.DAL/Models/Template.cs | 11 +++ PARR.GeneratorTemplates/GeneratorTemplate.cs | 2 - 10 files changed, 148 insertions(+), 40 deletions(-) create mode 100644 PARR.API/Contracts/V1/Requests/TemplateChangeStateRequest.cs 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