90 lines
2.8 KiB
C#
90 lines
2.8 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Dynamic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using Microsoft.Extensions.Configuration;
|
|
namespace APT.Infrastructure.Api
|
|
{
|
|
//public static class ConfigurationHelper
|
|
//{
|
|
// public static IConfigurationRoot Configuration { get; set; }
|
|
|
|
// private static InfluxDbOption _option;
|
|
// public static InfluxDbOption InfluxDbOption
|
|
// {
|
|
// get
|
|
// {
|
|
// if (_option == null)
|
|
// {
|
|
// _option = new InfluxDbOption();
|
|
// var s = Configuration.GetSection("InflexdbConfig").GetChildren();
|
|
// _option.Url= s.Any(i => i.Key == "Url") ? s.FirstOrDefault(i => i.Key == "Url").Value : "";
|
|
// _option.UserName = s.Any(i => i.Key == "UserName") ? s.FirstOrDefault(i => i.Key == "UserName").Value : "";
|
|
// _option.PassWord = s.Any(i => i.Key == "PassWord") ? s.FirstOrDefault(i => i.Key == "PassWord").Value : "";
|
|
// _option. = s.Any(i => i.Key == "") ? s.FirstOrDefault(i => i.Key == "").Value : "";
|
|
// _option.LogDbName = s.Any(i => i.Key == "LogDbName") ? s.FirstOrDefault(i => i.Key == "LogDbName").Value : "";
|
|
// _option.DosageDbName = s.Any(i => i.Key == "DosageDbName") ? s.FirstOrDefault(i => i.Key == "DosageDbName").Value : "";
|
|
// _option. = s.Any(i => i.Key == "EnergyValDbName") ? s.FirstOrDefault(i => i.Key == "EnergyValDbName").Value : "";
|
|
|
|
// }
|
|
// return _option;
|
|
// }
|
|
// }
|
|
//}
|
|
|
|
|
|
public class InfluxDbOption
|
|
{
|
|
/// <summary>
|
|
/// 地址
|
|
/// </summary>
|
|
public string Url { get; set; }
|
|
|
|
/// <summary>
|
|
/// 用户
|
|
/// </summary>
|
|
public string UserName { get; set; }
|
|
|
|
/// <summary>
|
|
/// 密码
|
|
/// </summary>
|
|
public string PassWord { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
/// 源标签历史数据
|
|
/// </summary>
|
|
public string SrcTagDbName { get; set; }
|
|
/// <summary>
|
|
/// 纠错数据表
|
|
/// </summary>
|
|
public string CorrectWaring { get; set; }
|
|
|
|
/// <summary>
|
|
/// Log
|
|
/// </summary>
|
|
public string LogDbName { get; set; }
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public string MaxDemandDbName { get; set; }
|
|
/// <summary>
|
|
/// 用量
|
|
/// </summary>
|
|
public string DosageDbName { get; set; }
|
|
/// <summary>
|
|
/// 价格
|
|
/// </summary>
|
|
public string EnergyValDbName { get; set; }
|
|
|
|
/// <summary>
|
|
/// 价格
|
|
/// </summary>
|
|
public string AppOnline { get; set; }
|
|
|
|
|
|
}
|
|
}
|