feat(api,core,dal,domain): Сохранение снапшотов состояния роботов.
This commit is contained in:
@@ -27,5 +27,11 @@
|
||||
/// Управление очередями
|
||||
/// </summary>
|
||||
public const string Task = "task";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Робот
|
||||
/// </summary>
|
||||
public const string Robot = "robot";
|
||||
}
|
||||
}
|
||||
|
||||
5
PARR.Domain/DTOs/RobotSnapshotDTO/CreateRobotSnapshot.cs
Normal file
5
PARR.Domain/DTOs/RobotSnapshotDTO/CreateRobotSnapshot.cs
Normal file
@@ -0,0 +1,5 @@
|
||||
namespace PARR.Domain.DTOs.RobotSnapshotDTO
|
||||
{
|
||||
public record CreateRobotSnapshot(int TemplateRobotsCount, int ScheduleRobotsCount, int MaxRobots, string Ip);
|
||||
|
||||
}
|
||||
17
PARR.Domain/DTOs/RobotSnapshotDTO/RobotSnapshotItem.cs
Normal file
17
PARR.Domain/DTOs/RobotSnapshotDTO/RobotSnapshotItem.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
namespace PARR.Domain.DTOs.RobotSnapshotDTO
|
||||
{
|
||||
public record RobotSnapshotItem
|
||||
{
|
||||
public Guid Id { get; init; }
|
||||
|
||||
public DateTimeOffset DateCreated { get; init; }
|
||||
|
||||
public int TemplateRobotsCount { get; init; }
|
||||
|
||||
public int ScheduleRobotsCount { get; init; }
|
||||
|
||||
public int MaxRobots { get; init; }
|
||||
|
||||
public required string Ip { get; init; }
|
||||
}
|
||||
}
|
||||
38
PARR.Domain/Entities/RobotEntities/RobotSnapshot.cs
Normal file
38
PARR.Domain/Entities/RobotEntities/RobotSnapshot.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PARR.Domain.Constants;
|
||||
using PARR.Domain.Entities.Base;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace PARR.Domain.Entities.RobotEntities
|
||||
{
|
||||
/// <summary>
|
||||
/// Снимок роботов с одного сервера
|
||||
/// </summary>
|
||||
[Table("Snapshots", Schema = DatabaseSchemas.Robot)]
|
||||
[Index(nameof(Ip), nameof(DateCreated))]
|
||||
[Comment("Снимки роботов")]
|
||||
public class RobotSnapshot : IBaseEntity
|
||||
{
|
||||
[Key]
|
||||
public Guid Id { get; set; }
|
||||
|
||||
public DateTimeOffset DateCreated { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public DateTimeOffset? DateModified { get; set; }
|
||||
|
||||
[Comment("Количество запущенных роботов по шаблонам")]
|
||||
public int TemplateRobotsCount { get; set; }
|
||||
|
||||
[Comment("Количество запущенных роботов по расписаниям")]
|
||||
public int ScheduleRobotsCount { get; set; }
|
||||
|
||||
[Comment("Максимально разрешенное количество роботов на сервере")]
|
||||
public int MaxRobots { get; set; }
|
||||
|
||||
[MaxLength(45)]
|
||||
[Comment("Текущий IP-адрес сервера")]
|
||||
public required string Ip { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user