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 PARR.DAL.Services.Interfaces;
using System.Text.Json;
@@ -26,13 +27,15 @@ namespace PARR.API.Controllers.V1
private readonly IUriService uriService;
private readonly MqSettings mqSettings;
private readonly IApplicationsInWorkService applicationsInWorkService;
private readonly IClientService clientService;
public TemplateActivatorController(
IValidator<TemplateActivatorRequest> validator,
IMqService mqService,
IUriService uriService,
MqSettings mqSettings,
IApplicationsInWorkService applicationsInWorkService
IApplicationsInWorkService applicationsInWorkService,
IClientService clientService
)
{
this.validator = validator;
@@ -40,6 +43,7 @@ namespace PARR.API.Controllers.V1
this.uriService = uriService;
this.mqSettings = mqSettings;
this.applicationsInWorkService = applicationsInWorkService;
this.clientService = clientService;
}
@@ -64,7 +68,8 @@ namespace PARR.API.Controllers.V1
var mqRequest = new TemplateActivatorMq
{
ApplicationInWorkId = applicationInWorkId,
Action = request.Action
Action = request.Action,
HistoryInitiator = new HistoryInitiator { InitiatorIp = clientService.GetClientIp()?.ToString(), InitiatorParrComponentId = ParrComponentsEnum.Api }
};
var msg = JsonSerializer.Serialize(mqRequest);