feat(dal, api): в таблицу Units добавлено поле LastLogon. Переделана авторизация для хостов (ЭК), теперь берется ip из связанных Units. Переделаны запросы авторизации в кеш. Переделан запрос и модель в influxdb. Обновлена статистика по юнитам и полям.

This commit is contained in:
Mikhail Trubnikov
2025-08-26 14:04:49 +10:00
parent a6385ea39a
commit c7bc8f60ef
19 changed files with 3994 additions and 137 deletions

View File

@@ -110,10 +110,10 @@
public const string Create = Base + "/generator-templates/";
}
public static class Host
public static class Unit
{
public const string GetAll = Base + "/hosts/";
public const string Get = Base + "/hosts/" + getParam;
public const string GetAll = Base + "/units/";
public const string Get = Base + "/units/" + getParam;
public const string getParam = "{id}";
}
@@ -227,17 +227,17 @@
public const string GetForPeriod = BaseStat + "/template-auto-controls/";
}
public static class StatHost
public static class StatUnit
{
public const string Get = BaseStat + "/hosts/";
public const string GetWithTemplates = BaseStat + "/hosts/templates";
public const string GetForPeriod = BaseStat + "/hosts/period";
public const string Get = BaseStat + "/units/";
public const string GetWithTemplates = BaseStat + "/units/templates";
public const string GetForPeriod = BaseStat + "/units/period";
}
public static class StatApplication
public static class StatUnitFieldValues
{
public const string Get = BaseStat + "/applications/";
public const string GetForPeriod = BaseStat + "/applications/period";
public const string Get = BaseStat + "/unit-field-values/";
public const string GetForPeriod = BaseStat + "/unit-field-values/period";
}
public static class StatOrder

View File

@@ -1,11 +0,0 @@
namespace PARR.API.Contracts.V1.Responses.Statistics
{
public class StatApplicationResponse
{
public int AllApplications { get; set; }
public int CreatedLastDay { get; set; }
public int UpdatedLastDay { get; set; }
}
}

View File

@@ -0,0 +1,11 @@
namespace PARR.API.Contracts.V1.Responses.Statistics
{
public class StatUnitFieldValuesResponse
{
public int AllValues { get; set; }
public int CreatedLastDay { get; set; }
//public int UpdatedLastDay { get; set; }
}
}

View File

@@ -1,9 +1,9 @@
namespace PARR.API.Contracts.V1.Responses.Statistics
{
public class StatHostPeriodResponse
public class StatUnitPeriodResponse
{
public DateOnly Date { get; set; }
public int CreatedHostsCount { get; set; }
public int CreatedUnitsCount { get; set; }
}
}

View File

@@ -1,6 +1,6 @@
namespace PARR.API.Contracts.V1.Responses.Statistics
{
public class StatHostResponse
public class StatUnitResponse
{
public int AllHosts { get; set; }

View File

@@ -1,8 +1,8 @@
namespace PARR.API.Contracts.V1.Responses.Statistics
{
public class StatHostTemplateResponse
public class StatUnitTemplateResponse
{
public int AllUnits { get; set; }
public int HostsInTemplates { get; set; }
public int UnitsInTemplates { get; set; }
}
}

View File

@@ -5,12 +5,13 @@
public Guid Id { get; set; }
public required string Name { get; set; }
}
public class UnitResponse : UnitBaseResponse
{
}
@@ -19,6 +20,8 @@
/// </summary>
public class UnitWithAttributesResponse : UnitBaseResponse
{
public DateTimeOffset? LastLogon { get; set; }
public List<AttributeResponse>? Attributes { get; set; }
}