feat(api, nextRun): записывать в историю template инициатора
This commit is contained in:
@@ -8,6 +8,7 @@ using PARR.API.Contracts.V1.Responses;
|
|||||||
using PARR.API.Contracts.V1.Responses.Base;
|
using PARR.API.Contracts.V1.Responses.Base;
|
||||||
using PARR.API.Controllers.V1.Base;
|
using PARR.API.Controllers.V1.Base;
|
||||||
using PARR.API.Services.Interfaces;
|
using PARR.API.Services.Interfaces;
|
||||||
|
using PARR.Common.Domain;
|
||||||
using PARR.Constants;
|
using PARR.Constants;
|
||||||
using PARR.DAL.Contracts;
|
using PARR.DAL.Contracts;
|
||||||
using PARR.DAL.Models;
|
using PARR.DAL.Models;
|
||||||
@@ -182,7 +183,7 @@ namespace PARR.API.Controllers.V1
|
|||||||
|
|
||||||
template.NextRun = nextRun;
|
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
|
#region Old, до выноса lastRun, nextRun в templates
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using PARR.BLL.Services.Interfaces;
|
using PARR.BLL.Services.Interfaces;
|
||||||
|
using PARR.Common.Domain;
|
||||||
using PARR.DAL.Services.Interfaces;
|
using PARR.DAL.Services.Interfaces;
|
||||||
using PARR.DAL.TransformServices;
|
using PARR.DAL.TransformServices;
|
||||||
using PARR.NextRun.Settings;
|
using PARR.NextRun.Settings;
|
||||||
@@ -67,7 +68,7 @@ namespace PARR.NextRun
|
|||||||
template.LastRun = template.NextRun;
|
template.LastRun = template.NextRun;
|
||||||
template.NextRun = 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}");
|
logger.LogDebug($"Обновлены значения полей NextRun: {template.NextRun}, LastRun: {template.LastRun} для шаблона {template.Name}, {template.Id}");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user