api(api, dal): IInfluxDbService. StatRobotStateController мониторинг роботов
This commit is contained in:
@@ -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>();
|
||||
|
||||
Reference in New Issue
Block a user