feat(dal, api): в таблицу RobotHistories добавлено поле RobotIp. Из таблицы AppInWorks удалены поля Next/LastRun. В историю работы роботов, пишется ip робота.
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user