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

@@ -27,13 +27,15 @@ namespace PARR.API.Controllers.V1
private readonly IUriService uriService;
private readonly IRobotHistoryService robotHistoryService;
private readonly IRobotConfigurationService robotConfigurationService;
private readonly IClientService clientService;
public RobotHistoryController(
IValidator<RobotHistoryRequest> validator,
IMapper mapper,
IUriService uriService,
IRobotHistoryService robotHistoryService,
IRobotConfigurationService robotConfigurationService
IRobotConfigurationService robotConfigurationService,
IClientService clientService
)
{
this.validator = validator;
@@ -41,6 +43,7 @@ namespace PARR.API.Controllers.V1
this.uriService = uriService;
this.robotHistoryService = robotHistoryService;
this.robotConfigurationService = robotConfigurationService;
this.clientService = clientService;
}
@@ -109,7 +112,8 @@ namespace PARR.API.Controllers.V1
RobotMessage = request.RobotMessage,
EsppMessage = request.EsppMessage,
TaskStatusCode = config.TaskStatusCode,
RobotConfigurationId = request.TaskId
RobotConfigurationId = request.TaskId,
RobotIp = clientService.GetClientIp()?.ToString()
};
if (!await robotHistoryService.CreateAsync(history) || !await robotHistoryService.CommitAsync())