From 5e0c249f1bc875a4d608caaa3e06a72a3c518b3b Mon Sep 17 00:00:00 2001 From: Mikhail Trubnikov Date: Tue, 8 Oct 2024 16:37:58 +1000 Subject: [PATCH] =?UTF-8?q?feat(api,=20nextRun):=20=D0=B7=D0=B0=D0=BF?= =?UTF-8?q?=D0=B8=D1=81=D1=8B=D0=B2=D0=B0=D1=82=D1=8C=20=D0=B2=20=D0=B8?= =?UTF-8?q?=D1=81=D1=82=D0=BE=D1=80=D0=B8=D1=8E=20template=20=D0=B8=D0=BD?= =?UTF-8?q?=D0=B8=D1=86=D0=B8=D0=B0=D1=82=D0=BE=D1=80=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PARR.API/Controllers/V1/RobotTaskController.cs | 3 ++- PARR.NextRun/NextRunManager.cs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/PARR.API/Controllers/V1/RobotTaskController.cs b/PARR.API/Controllers/V1/RobotTaskController.cs index 5c53fa99..351e8db4 100644 --- a/PARR.API/Controllers/V1/RobotTaskController.cs +++ b/PARR.API/Controllers/V1/RobotTaskController.cs @@ -8,6 +8,7 @@ using PARR.API.Contracts.V1.Responses; using PARR.API.Contracts.V1.Responses.Base; using PARR.API.Controllers.V1.Base; using PARR.API.Services.Interfaces; +using PARR.Common.Domain; using PARR.Constants; using PARR.DAL.Contracts; using PARR.DAL.Models; @@ -182,7 +183,7 @@ namespace PARR.API.Controllers.V1 template.NextRun = nextRun; - await robotConfigurationService.CommitAsync(); + await robotConfigurationService.CommitAsync(new HistoryInitiator { InitiatorComment = "При получении задания роботом, обновил NextRun", InitiatorIp = clientService.GetClientIp()?.ToString(), InitiatorParrComponentId = ParrComponentsEnum.Api }); } #region Old, до выноса lastRun, nextRun в templates diff --git a/PARR.NextRun/NextRunManager.cs b/PARR.NextRun/NextRunManager.cs index 3ec8fcf1..2d8e9cab 100644 --- a/PARR.NextRun/NextRunManager.cs +++ b/PARR.NextRun/NextRunManager.cs @@ -2,6 +2,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using PARR.BLL.Services.Interfaces; +using PARR.Common.Domain; using PARR.DAL.Services.Interfaces; using PARR.DAL.TransformServices; using PARR.NextRun.Settings; @@ -67,7 +68,7 @@ namespace PARR.NextRun template.LastRun = template.NextRun; template.NextRun = nextRun; - if (await templateService.CommitAsync()) + if (await templateService.CommitAsync(new HistoryInitiator { InitiatorComment = "Обновлён NextRun", InitiatorParrComponentId = Constants.ParrComponentsEnum.NextRun })) logger.LogDebug($"Обновлены значения полей NextRun: {template.NextRun}, LastRun: {template.LastRun} для шаблона {template.Name}, {template.Id}"); else {