#region 实现用户评论展示
public ActionResult RecommedPartial(int rid)
{
Uri uri = new Uri(path);
HttpClient httpClient = new HttpClient();
httpClient.BaseAddress = uri;
var pashAction = httpClient.GetAsync("api/ReaderComment/rid="+rid);
var pashResult = pashAction.Result;
if (pashResult.StatusCode == System.Net.HttpStatusCode.OK)
{
var result = pashResult.Content.ReadAsStringAsync().Result;
var list = JsonConvert.DeserializeObject>(result);
httpClient.Dispose();
return PartialView("RecommedPartial", list);
}
else
{
return Content("获取代码错误:" + pashResult.StatusCode);
}
}
#endregion
#region 实现用户评论展示
public ActionResult RecommedPartial(int rid)
{
Uri uri = new Uri(path);
HttpClient httpClient = new HttpClient();
httpClient.BaseAddress = uri;
var pashAction = httpClient.GetAsync("api/ReaderComment/rid="+rid);
var pashResult = pashAction.Result;
if (pashResult.StatusCode == System.Net.HttpStatusCode.OK)
{
var result = pashResult.Content.ReadAsStringAsync().Result;
var list = JsonConvert.DeserializeObject>(result);
httpClient.Dispose();
return PartialView("RecommedPartial", list);
}
else
{
return Content("获取代码错误:" + pashResult.StatusCode);
}
}
#endregion
//连接redis服务器
public static RedisClient client = new RedisClient("192.168.43.30", 6379);
public static List
public static string path = "http://localhost:30889/";