using System.Collections.Generic;
using System.Linq;
namespace IOB_UT_NEXT.Config.Base
{
///
/// Set comandi URI x chiamate server
///
public class CmdUriDto
{
#region Public Constructors
///
/// Init classe gestione comandi
///
///
public CmdUriDto(string baseURI)
{
_baseUri = baseURI;
}
#endregion Public Constructors
#region Public Properties
///
/// comando base x USER LOG - salvataggio parametri extra sistema MAPO
///
public string ULog { get; set; } = "IOB/ulog/";
///
/// comando base x USER LOG - salvataggio parametri extra sistema MAPO in modalità JSON
/// payload come lista
///
public string ULogJson { get; set; } = "IOB/ulogJson/";
#endregion Public Properties
#region Public Methods
///
/// Recupera path/URI comando richiesto (SE disponibile) senno default
///
///
///
public string GetCommand(string key)
{
// default ad implicito con IOB...
string answ = $"{_baseUri}/{key}/";
if (CurrSetup.ContainsKey(key))
{
answ = CurrSetup[key];
}
return answ;
}
public Dictionary StdCommands()
{
CurrSetup = new Dictionary();
//CurrSetup.Add("alive", "IOB");
CurrSetup.Add("alive", _baseUri);
//CurrSetup.Add("Base", "IOB/input/");
//CurrSetup.Add("BaseJson", "IOB/evListJson/");
//CurrSetup.Add("RawTransfJson", "IOB/rawTransfJson/");
//CurrSetup.Add("Enabled", "IOB/enabled/");
//CurrSetup.Add("Flog", "IOB/flog/");
//CurrSetup.Add("FlogJson", "IOB/flogJson/");
//CurrSetup.Add("fixDailyDossier", "IOB/fixDailyDossier/");
//CurrSetup.Add("fixDailyOdl", "IOB/fixDailyOdl/");
//CurrSetup.Add("fixDailyOdlConfPzCount", "IOB/fixDailyOdlConfPzCount/");
//CurrSetup.Add("forceCreatePOdl", "IOB/forceCreatePOdl/");
//CurrSetup.Add("forceSplitOdlFull", "IOB/forceSplitOdlFull/");
//CurrSetup.Add("getPOdlAct", "IOB/getPOdlAct/");
//CurrSetup.Add("IdleTime", "IOB/getIdlePeriod/");
//CurrSetup.Add("OdlStarted", "IOB/getCurrOdlStart/");
//CurrSetup.Add("Reboot", "IOB/sendReboot.aspx?idxMacchina=");
//CurrSetup.Add("savePzCountInc", "IOB/savePzCountInc/");
//CurrSetup.Add("savePzCountIncAtDate", "IOB/savePzCountIncAtDate/");
// riordino
CurrSetup = CurrSetup.OrderBy(x => x.Key).ToDictionary(x => x.Key, x => x.Value);
return CurrSetup;
}
#endregion Public Methods
#region Protected Properties
protected string _baseUri { get; set; } = "IOB";
protected Dictionary CurrSetup { get; set; } = new Dictionary();
#endregion Protected Properties
}
}