コード例 #1
0
 /// <summary>
 /// 返回当前地区影院列表
 /// </summary>
 /// <returns></returns>
 public async Task <List <ResultCinemasList> > QueryCinemas(string cityId)
 {
     return(await Task.Run(() =>
     {
         Dictionary <string, string> dic = new Dictionary <string, string>();
         dic.Add("channelId", channelId);
         dic.Add("cityId", cityId);
         string sign = HttpPostHelper.GetParamSrc(dic) + secret;
         sign = MD5.Md5(sign).ToLowerInvariant();
         PostQueryCinemas temp = new PostQueryCinemas();
         temp.channelId = channelId;
         temp.cityId = cityId;
         temp.sign = sign;
         string url = $"{http}manman/index.php/open/partner/queryCinemas";
         string result = HttpPostHelper.DoHttpPost(url, JsonConvert.SerializeObject(temp));
         ResultQueryCinemas resultData = JsonConvert.DeserializeObject <ResultQueryCinemas>(result);
         if (resultData.code == 0)
         {
             return resultData.result.cinemasList;
         }
         else
         {
             throw new AppException(resultData.errorMsg);
         }
     }));
 }
コード例 #2
0
 /// <summary>
 /// 获取当前热映影片
 /// </summary>
 /// <returns></returns>
 public async Task <List <ResultFilm> > HotShowingMovies()
 {
     return(await Task.Run(() =>
     {
         Dictionary <string, string> dic = new Dictionary <string, string>();
         dic.Add("channelId", channelId);
         string sign = MD5.Md5(HttpPostHelper.GetParamSrc(dic) + secret).ToLowerInvariant();
         PostHotShowingMovies temp = new PostHotShowingMovies();
         temp.channelId = channelId;
         temp.sign = sign;
         string url = $"{http}manman/index.php/open/partner/hotShowingMovies";
         string result = HttpPostHelper.DoHttpPost(url, JsonConvert.SerializeObject(temp));
         ResultHotResult resultData = JsonConvert.DeserializeObject <ResultHotResult>(result);
         if (resultData.code == 0)
         {
             return resultData.result.filmList;
         }
         else
         {
             throw new AppException(resultData.message);
         }
     }));
 }