feat(dal,api,nextRun,templateGenerator,templateActivator): IsUnused вынесена в TemplateStatusType
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using PARR.API.Contracts.V1;
|
||||
using PARR.API.Contracts.V1.Requests;
|
||||
using PARR.API.Contracts.V1.Responses.Base;
|
||||
using PARR.API.Controllers.V1.Base;
|
||||
using PARR.API.Services.Implementations;
|
||||
@@ -7,6 +8,8 @@ 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;
|
||||
|
||||
namespace PARR.API.Controllers.V1
|
||||
@@ -17,18 +20,21 @@ namespace PARR.API.Controllers.V1
|
||||
private readonly IMqService mqService;
|
||||
private readonly IUriService uriService;
|
||||
private readonly MqSettings mqSettings;
|
||||
private readonly IClientService clientService;
|
||||
|
||||
public SyncTaskController(
|
||||
ILogger<SyncTaskController> logger,
|
||||
IMqService mqService,
|
||||
IUriService uriService,
|
||||
MqSettings mqSettings
|
||||
MqSettings mqSettings,
|
||||
IClientService clientService
|
||||
)
|
||||
{
|
||||
this.logger = logger;
|
||||
this.mqService = mqService;
|
||||
this.uriService = uriService;
|
||||
this.mqSettings = mqSettings;
|
||||
this.clientService = clientService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -36,13 +42,20 @@ namespace PARR.API.Controllers.V1
|
||||
/// </summary>
|
||||
/// <param name="id">ИД шаблона</param>
|
||||
[HttpPost(ApiRoutes.SyncTask.MatchTemplatesForJob)]
|
||||
public async Task<IActionResult> MatchTemplatesForJob([FromRoute] Guid jobId)
|
||||
public async Task<IActionResult> MatchTemplatesForJob([FromRoute] Guid jobId, [FromBody] MatchTemplatesForJobRequest request)
|
||||
{
|
||||
//24b3529a-dd43-444a-b10e-ac54fefd046a
|
||||
var matchTemplateTask = new TemplateMatcherMq
|
||||
{
|
||||
Id = jobId,
|
||||
EntityType = Constants.SyncTaskEntityTypeEnum.Job
|
||||
EntityType = Constants.SyncTaskEntityTypeEnum.Job,
|
||||
Action = request.Action,
|
||||
Initiator = new HistoryInitiator
|
||||
{
|
||||
InitiatorIp = clientService.GetClientIp()?.ToString(),
|
||||
InitiatorParrComponentId = ParrComponentsEnum.Api,
|
||||
InitiatorComment = $"Отправлен запрос из GUI, action: {request.Action.ToString()}"
|
||||
}
|
||||
};
|
||||
|
||||
var msg = JsonSerializer.Serialize(matchTemplateTask);
|
||||
|
||||
Reference in New Issue
Block a user