feat(dal, api): в таблицу RobotHistories добавлено поле RobotIp. Из таблицы AppInWorks удалены поля Next/LastRun. В историю работы роботов, пишется ip робота.

This commit is contained in:
Mikhail Trubnikov
2024-07-22 14:48:44 +10:00
parent fc197a6a5b
commit 08b8fba8a5
9 changed files with 3015 additions and 14 deletions

View File

@@ -7,6 +7,7 @@ using PARR.API.Contracts.V1.Requests;
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.Constants;
using PARR.DAL.Contracts;
using PARR.DAL.Models;
@@ -20,16 +21,19 @@ namespace PARR.API.Controllers.V1
private readonly IRobotConfigurationService robotConfigurationService;
private readonly IRobotHistoryService robotHistoryService;
private readonly IMapper mapper;
private readonly IClientService clientService;
public RobotTaskRobotStatusController(
IRobotConfigurationService robotConfigurationService,
IRobotHistoryService robotHistoryService,
IMapper mapper
IMapper mapper,
IClientService clientService
)
{
this.robotConfigurationService = robotConfigurationService;
this.robotHistoryService = robotHistoryService;
this.mapper = mapper;
this.clientService = clientService;
}
@@ -67,7 +71,8 @@ namespace PARR.API.Controllers.V1
Id = Guid.NewGuid(),
HistoryLevel = (int)historyLevel,
TaskStatusCode = config.TaskStatusCode,
RobotConfigurationId = config.Id
RobotConfigurationId = config.Id,
RobotIp = clientService.GetClientIp()?.ToString()
};
await robotHistoryService.CreateAsync(history);
await robotHistoryService.CommitAsync();