diff --git a/RZ.Cache/RZCache/Controllers/ValuesController.cs b/RZ.Cache/RZCache/Controllers/ValuesController.cs index 14c6eaf..4ad975b 100644 --- a/RZ.Cache/RZCache/Controllers/ValuesController.cs +++ b/RZ.Cache/RZCache/Controllers/ValuesController.cs @@ -70,6 +70,8 @@ public RZController(IConfiguration config, IMemoryCache memoryCache) RuckZuck_WCF.RZRestProxy.CatalogTTL = int.Parse(_config.GetSection("CatalogTTL").Value ?? _config.GetSection("RuckZuck:CatalogTTL").Value); RuckZuck_WCF.RZRestProxy.localURL = config.GetSection("localURL").Value ?? _config.GetSection("RuckZuck:localURL").Value; RuckZuck_WCF.RZRestProxy._cache = _cache; + RuckZuck_WCF.RZRestProxy.Proxy = config.GetSection("Proxy").Value ?? _config.GetSection("RuckZuck:Proxy").Value; + RuckZuck_WCF.RZRestProxy.ProxyUserPW = config.GetSection("ProxyUserPW ").Value ?? _config.GetSection("RuckZuck:ProxyUserPW").Value; } [Route("AuthenticateUser")] @@ -159,11 +161,11 @@ public ActionResult GetSWDefinition(string name = "", string ver = "", string ma [HttpGet] [Route("Feedback")] - [Route("Feedback/{name}/{ver}/{man}/{ok}/{user}/{text}")] - public ActionResult Feedback(string name, string ver, string man = "", string ok = "", string user = "", string text = "") + [Route("Feedback/{name}/{ver}/{man}/{arch}/{ok}/{user}/{text}")] + public ActionResult Feedback(string name, string ver, string man = "", string arch = "", string ok = "", string user = "", string text = "") { RuckZuck_WCF.RZRestProxy.contentType = (string)Request.Headers["Accept"] ?? "application/xml"; - return Content(RuckZuck_WCF.RZRestProxy.Feedback(name, ver, man, ok, user, text).Result, "text/xml"); + return Content(RuckZuck_WCF.RZRestProxy.Feedback(name, ver, man, arch, ok, user, text).Result, "text/xml"); } [HttpGet] @@ -184,6 +186,15 @@ public void TrackDownloads(string id) RuckZuck_WCF.RZRestProxy.TrackDownloads(id); } + [HttpGet] + [Route("TrackDownloadsNew")] + [Route("TrackDownloadsNew/{SWId}/{arch}")] + public void TrackDownloadsNew(string SWId, string arch) + { + RuckZuck_WCF.RZRestProxy.contentType = (string)Request.Headers["Accept"] ?? "application/xml"; + RuckZuck_WCF.RZRestProxy.TrackDownloadsNew(SWId, arch); + } + [HttpPost] [Route("CheckForUpdateXml")] public ActionResult CheckForUpdateXml() diff --git a/RZ.Cache/RZCache/RZRestProxy.cs b/RZ.Cache/RZCache/RZRestProxy.cs index 9782ed2..125f27e 100644 --- a/RZ.Cache/RZCache/RZRestProxy.cs +++ b/RZ.Cache/RZCache/RZRestProxy.cs @@ -300,7 +300,7 @@ public static string SWGet(string PackageName, string Manufacturer, string Packa return ""; } - public static async Task Feedback(string productName, string productVersion, string manufacturer, string working, string userKey, string feedback) + public static async Task Feedback(string productName, string productVersion, string manufacturer, string architecture, string working, string userKey, string feedback) { if (!string.IsNullOrEmpty(feedback)) { @@ -309,7 +309,7 @@ public static async Task Feedback(string productName, string productVers var oClient = new HttpClient(); oClient.DefaultRequestHeaders.Add("AuthenticatedToken", Token); oClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue(contentType)); - var oRes = await oClient.GetStringAsync(sURL + "/rest/Feedback?name=" + WebUtility.UrlEncode(productName) + "&ver=" + WebUtility.UrlEncode(productVersion) + "&man=" + WebUtility.UrlEncode(manufacturer) + "&ok=" + working + "&user=" + WebUtility.UrlEncode(userKey) + "&text=" + WebUtility.UrlEncode(feedback)); + var oRes = await oClient.GetStringAsync(sURL + "/rest/Feedback?name=" + WebUtility.UrlEncode(productName) + "&ver=" + WebUtility.UrlEncode(productVersion) + "&man=" + WebUtility.UrlEncode(manufacturer) + "&arch=" + architecture + "&ok=" + working + "&user=" + WebUtility.UrlEncode(userKey) + "&text=" + WebUtility.UrlEncode(feedback)); return oRes; } catch { } @@ -577,10 +577,13 @@ public static async void TrackDownloadsNew(string SWId, string Architecture) { try { - var oClient = new HttpClient(); - oClient.DefaultRequestHeaders.Add("AuthenticatedToken", Token); - oClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue(contentType)); - await oClient.GetStringAsync(sURL + "/rest/TrackDownloadsNew?SWId=" + SWId.ToString() + " & arch = " + WebUtility.UrlEncode(Architecture)); + if (!string.IsNullOrEmpty(SWId) & !string.IsNullOrEmpty(Architecture)) + { + var oClient = new HttpClient(); + oClient.DefaultRequestHeaders.Add("AuthenticatedToken", Token); + oClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue(contentType)); + await oClient.GetStringAsync(sURL + "/rest/TrackDownloadsNew?SWId=" + SWId.ToString() + "&arch=" + WebUtility.UrlEncode(Architecture)); + } } catch { } }