Skip to content

Commit

Permalink
Fix: FeedbackNew parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
rzander committed Sep 25, 2017
1 parent 7499a56 commit 835f1de
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
17 changes: 14 additions & 3 deletions RZ.Cache/RZCache/Controllers/ValuesController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down Expand Up @@ -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]
Expand All @@ -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()
Expand Down
15 changes: 9 additions & 6 deletions RZ.Cache/RZCache/RZRestProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ public static string SWGet(string PackageName, string Manufacturer, string Packa
return "";
}

public static async Task<string> Feedback(string productName, string productVersion, string manufacturer, string working, string userKey, string feedback)
public static async Task<string> Feedback(string productName, string productVersion, string manufacturer, string architecture, string working, string userKey, string feedback)
{
if (!string.IsNullOrEmpty(feedback))
{
Expand All @@ -309,7 +309,7 @@ public static async Task<string> 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 { }
Expand Down Expand Up @@ -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 { }
}
Expand Down

0 comments on commit 835f1de

Please sign in to comment.