using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using YamlDotNet.Core.Tokens; namespace IOB_UT_NEXT.Config.Base { public class ServerMapoDto { /// /// Indica il metodo di trasporto http/https /// public string Transport { get; set; } = "http"; /// /// Indirizzo IP server /// public string IpAddr { get; set; } = "127.0.0.1"; /// /// URL Base del server applicativo /// public string BaseAppUrl { get; set; } = "/MP/IO/"; /// /// Restituisce la API del comando richiesto dalla BaseUrl /// /// Comando richiesto da comporre /// public string ApiUrl(string CmdReq) { // default ad implicito con IOB... string answ = $"{BaseAppUrl}IOB/{CmdReq}/"; if (Commands.ContainsKey(CmdReq)) { answ = $"{BaseAppUrl}{Commands[CmdReq]}"; } return answ; #if false string answ = BaseAppUrl; if (Commands.ContainsKey(CmdReq)) { answ = $"{BaseAppUrl}{Commands[CmdReq]}"; } // altrimenti prendo cmd base IOB e compongo... else { answ = $"{BaseAppUrl}/IOB/{CmdReq}"; } return answ; #endif } /// /// Dizionario comandi configurati /// public Dictionary Commands { get; set; } = new CmdUriDto("IOB").StdCommands(); /// /// Installazione di riferimento /// public string ClientInstall { get; set; } = "SW"; } }