feat(api, bll, dal, generatorTemplates, templateActivator): запись истории изменения шаблонов

This commit is contained in:
Mikhail Trubnikov
2024-10-08 10:29:34 +10:00
parent 54fed9b597
commit a494b69ee6
22 changed files with 140 additions and 67 deletions

View File

@@ -9,6 +9,7 @@ using PARR.API.Services.Interfaces;
using PARR.API.Settings;
using PARR.BLL.Domain.Mq;
using PARR.BLL.Services.Interfaces;
using PARR.Common.Domain;
using PARR.Constants;
using System.Text.Json;
@@ -21,18 +22,21 @@ namespace PARR.API.Controllers.V1
private readonly IMqService mqService;
private readonly IUriService uriService;
private readonly MqSettings mqSettings;
private readonly IClientService clientService;
public GeneratorTemplateController(
IValidator<GeneratorTemplateRequest> validator,
IMqService mqService,
IUriService uriService,
MqSettings mqSettings
MqSettings mqSettings,
IClientService clientService
)
{
this.validator = validator;
this.mqService = mqService;
this.uriService = uriService;
this.mqSettings = mqSettings;
this.clientService = clientService;
}
/// <summary>
@@ -60,7 +64,8 @@ namespace PARR.API.Controllers.V1
WorkId = request.WorkId,
StatusEk = status,
IsActiveTemplate = request.IsActiveTemplate,
IsActiveSchedule = request.IsActiveSchedule
IsActiveSchedule = request.IsActiveSchedule,
HistoryInitiator = new HistoryInitiator { InitiatorIp = clientService.GetClientIp()?.ToString(), InitiatorParrComponentId = ParrComponentsEnum.Api }
};
var msg = JsonSerializer.Serialize(obj);