Exemple #1
0
 /// <summary>获取我的探索列表</summary>
 /// <exception cref="ApiException">A server side error occurred.</exception>
 public Tourism.STD.Models.InfoModelList <Tourism.STD.Models.SmallApp.User.MyExplorationItem> GetMyExploration(NetCore.PageInfo page)
 {
     return(System.Threading.Tasks.Task.Run(async() => await GetMyExplorationAsync(page, System.Threading.CancellationToken.None)).GetAwaiter().GetResult());
 }
Exemple #2
0
        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <summary>获取我的探索列表</summary>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public async System.Threading.Tasks.Task <Tourism.STD.Models.InfoModelList <Tourism.STD.Models.SmallApp.User.MyExplorationItem> > GetMyExplorationAsync(NetCore.PageInfo page, System.Threading.CancellationToken cancellationToken)
        {
            if (page == null)
            {
                throw new System.ArgumentNullException("page");
            }

            var urlBuilder_ = new System.Text.StringBuilder();

            urlBuilder_.Append("SmallAppApi/User/GetMyExploration");

            var client_        = _httpClient;
            var disposeClient_ = false;

            try
            {
                using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false))
                {
                    var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(page, _settings.Value));
                    content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
                    request_.Content             = content_;
                    request_.Method = new System.Net.Http.HttpMethod("POST");
                    request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));

                    PrepareRequest(client_, request_, urlBuilder_);
                    var url_ = urlBuilder_.ToString();
                    request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
                    PrepareRequest(client_, request_, url_);

                    var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);

                    var disposeResponse_ = true;
                    try
                    {
                        var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value);
                        if (response_.Content != null && response_.Content.Headers != null)
                        {
                            foreach (var item_ in response_.Content.Headers)
                            {
                                headers_[item_.Key] = item_.Value;
                            }
                        }

                        ProcessResponse(client_, response_);

                        var status_ = (int)response_.StatusCode;
                        if (status_ == 200)
                        {
                            var objectResponse_ = await ReadObjectResponseAsync <Tourism.STD.Models.InfoModelList <Tourism.STD.Models.SmallApp.User.MyExplorationItem> >(response_, headers_).ConfigureAwait(false);

                            return(objectResponse_.Object);
                        }
                        else
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);

                            throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
                        }
                    }
                    finally
                    {
                        if (disposeResponse_)
                        {
                            response_.Dispose();
                        }
                    }
                }
            }
            finally
            {
                if (disposeClient_)
                {
                    client_.Dispose();
                }
            }
        }
Exemple #3
0
 /// <summary>获取活动列表</summary>
 /// <exception cref="ApiException">A server side error occurred.</exception>
 public Tourism.STD.Models.InfoModelList <Tourism.STD.Models.Activity.WebActivityInfo> PullData(NetCore.PageInfo page)
 {
     return(System.Threading.Tasks.Task.Run(async() => await PullDataAsync(page, System.Threading.CancellationToken.None)).GetAwaiter().GetResult());
 }
Exemple #4
0
 /// <summary>获取我的探索列表</summary>
 /// <exception cref="ApiException">A server side error occurred.</exception>
 public System.Threading.Tasks.Task <Tourism.STD.Models.InfoModelList <Tourism.STD.Models.SmallApp.User.MyExplorationItem> > GetMyExplorationAsync(NetCore.PageInfo page)
 {
     return(GetMyExplorationAsync(page, System.Threading.CancellationToken.None));
 }
Exemple #5
0
 /// <summary>获取活动列表</summary>
 /// <exception cref="ApiException">A server side error occurred.</exception>
 public System.Threading.Tasks.Task <Tourism.STD.Models.InfoModelList <Tourism.STD.Models.Activity.WebActivityInfo> > PullDataAsync(NetCore.PageInfo page)
 {
     return(PullDataAsync(page, System.Threading.CancellationToken.None));
 }
Exemple #6
0
 /// <summary>获取举报理由列表</summary>
 /// <exception cref="ApiException">A server side error occurred.</exception>
 public Tourism.STD.Models.InfoModelList <Tourism.STD.Models.Report.ReasonsInfo> GetReasonsList(NetCore.PageInfo page)
 {
     return(System.Threading.Tasks.Task.Run(async() => await GetReasonsListAsync(page, System.Threading.CancellationToken.None)).GetAwaiter().GetResult());
 }
Exemple #7
0
 /// <summary>获取举报理由列表</summary>
 /// <exception cref="ApiException">A server side error occurred.</exception>
 public System.Threading.Tasks.Task <Tourism.STD.Models.InfoModelList <Tourism.STD.Models.Report.ReasonsInfo> > GetReasonsListAsync(NetCore.PageInfo page)
 {
     return(GetReasonsListAsync(page, System.Threading.CancellationToken.None));
 }
Exemple #8
0
 /// <summary>获取景区记录列表</summary>
 /// <exception cref="ApiException">A server side error occurred.</exception>
 public Tourism.STD.Models.InfoModelList <Tourism.STD.Models.SmallApp.Index.AnnalItem> Annal(NetCore.PageInfo page)
 {
     return(System.Threading.Tasks.Task.Run(async() => await AnnalAsync(page, System.Threading.CancellationToken.None)).GetAwaiter().GetResult());
 }
Exemple #9
0
 /// <summary>获取景区记录列表</summary>
 /// <exception cref="ApiException">A server side error occurred.</exception>
 public System.Threading.Tasks.Task <Tourism.STD.Models.InfoModelList <Tourism.STD.Models.SmallApp.Index.AnnalItem> > AnnalAsync(NetCore.PageInfo page)
 {
     return(AnnalAsync(page, System.Threading.CancellationToken.None));
 }