58 lines
1.4 KiB
C#
58 lines
1.4 KiB
C#
|
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();
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
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);
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
}
|