api(api, dal): IInfluxDbService. StatRobotStateController мониторинг роботов

This commit is contained in:
Mikhail Trubnikov
2024-05-28 14:35:39 +10:00
parent 0007170079
commit e5215b7dc2
12 changed files with 260 additions and 0 deletions

View File

@@ -5,6 +5,7 @@ using PARR.DAL.CacheServices;
using PARR.DAL.Configurations.DbSettings;
using PARR.DAL.Context;
using PARR.DAL.Contracts;
using PARR.DAL.InfluxDbServices;
using PARR.DAL.Services.Implementation;
using PARR.DAL.Services.Implementations;
using PARR.DAL.Services.Interfaces;
@@ -29,6 +30,8 @@ namespace PARR.DAL
.UseNpgsql(configuration.GetConnectionString("DefaultConnection"))
);
#region Redis
services.AddStackExchangeRedisCache(opt =>
{
opt.Configuration = configuration.GetConnectionString("RedisConnection");
@@ -36,6 +39,19 @@ namespace PARR.DAL
services.AddTransient<IRedisCacheService, RedisCacheService>();
#endregion
#region InfluxDb
var influxDbSettings = new InfluxDbSettings();
configuration.GetSection(nameof(InfluxDbSettings)).Bind(influxDbSettings);
services.AddSingleton(influxDbSettings);
services.AddTransient<IInfluxDbService, InfluxDbService>();
#endregion
// Entity services
services.AddTransient<IHostService, HostService>();
services.AddTransient<IApplicationService, ApplicationService>();