ibms-dome/Repository/Helper/BackEndConfigHelper.cs

76 lines
2.0 KiB
C#
Raw Permalink Normal View History

2023-03-02 14:24:34 +08:00
using Microsoft.Extensions.Options;
using Repository.Models;
namespace Repository.Helper
{
public interface IBackEndConfigHelper
{
/// <summary>
/// 取得url_slot
/// </summary>
/// <returns></returns>
string GetUrlSlot();
/// <summary>
/// 取得obixQuery
/// </summary>
/// <returns></returns>
string GetobixQuery();
string GetobixHisBqlQuery();
string GetobixHisUrlQuery();
2023-04-11 10:28:33 +08:00
/// <summary>
/// 取 tag 分8段 or 5 段
/// </summary>
/// <returns></returns>
string Getobixtag_quantity();
2023-04-21 17:40:18 +08:00
string Getobixtag_acc();
string Getobixtag_pass();
2023-03-02 14:24:34 +08:00
}
public class BackEndConfigHelper : IBackEndConfigHelper
{
private NiagaraDataSyncConfig _NiagaraDataSyncConfig;
private EDFunction ed;
public BackEndConfigHelper(IOptions<BackEndConfig> BackEndConfig)
{
_NiagaraDataSyncConfig = BackEndConfig.Value.NiagaraDataSyncConfig;
ed = new EDFunction();
}
public string GetUrlSlot()
{
return ed.AESDecrypt(_NiagaraDataSyncConfig.UrlSlot);
}
public string GetobixQuery()
{
return ed.AESDecrypt(_NiagaraDataSyncConfig.ObixQuery);
}
public string GetobixHisBqlQuery()
{
return ed.AESDecrypt(_NiagaraDataSyncConfig.ObixHisBqlQuery);
}
public string GetobixHisUrlQuery()
{
return ed.AESDecrypt(_NiagaraDataSyncConfig.ObixHisUrlQuery);
}
2023-04-11 10:28:33 +08:00
public string Getobixtag_quantity()
{
return ed.AESDecrypt(_NiagaraDataSyncConfig.tag_quantity);
}
2023-04-21 17:40:18 +08:00
public string Getobixtag_acc()
{
return ed.AESDecrypt(_NiagaraDataSyncConfig.Account);
}
public string Getobixtag_pass()
{
return ed.AESDecrypt(_NiagaraDataSyncConfig.Password);
}
2023-03-02 14:24:34 +08:00
}
}