Beispiel #1
0
        /// <summary>
        /// Get Post Nagivation
        /// </summary>
        /// <param name="postSearchModel">Post search condition</param>
        /// <returns>Post Nagivation</returns>
        public async Task <BaseResponse <PostNavigationDetailViewModel> > GetPostNagivation(PostSearchModel postSearchModel)
        {
            try
            {
                var apiExecute = new APIExcute(AuthenticationType.Bearer);
                var url        = string.Format("{0}{1}",
                                               (_baseAdminApiUrl + _adminApiUrl.Post.PostNagivation),
                                               ConvertToUrlParameter(postSearchModel));
                var response = await apiExecute.GetData <PostNavigationDetailViewModel>(url, token : _token);

                return(response);
            }
            catch (Exception ex)
            {
                return(BaseResponse <PostNavigationDetailViewModel> .InternalServerError(ex));
            }
        }
Beispiel #2
0
        /// <summary>
        /// Search all available travel blog
        /// </summary>
        /// <param name="searchModel">Search config</param>
        /// <returns>Travel blog</returns>
        public async Task <BaseResponse <PagedListClient <PostViewModel> > > Search(PostSearchModel searchModel)
        {
            try
            {
                var apiExecute = new APIExcute(AuthenticationType.Bearer);

                var url = string.Format("{0}{1}",
                                        (_baseAdminApiUrl + _adminApiUrl.Post.Search),
                                        ConvertToUrlParameter(searchModel));

                var response = await apiExecute.GetData <PagedListClient <PostViewModel> >(url, token : _token);

                return(response);
            }
            catch (Exception ex)
            {
                return(BaseResponse <PagedListClient <PostViewModel> > .InternalServerError(ex));
            }
        }
Beispiel #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="postId"></param>
        /// <param name="languageId"></param>
        /// <returns></returns>
        public async Task <BaseResponse <PostDetailViewModel> > GetPostDetail(long postDetailId)
        {
            try
            {
                var apiExecute = new APIExcute(AuthenticationType.Bearer);
                var url        = string.Format("{0}{1}/{2}",
                                               _baseAdminApiUrl,
                                               _adminApiUrl.Post.PostDetailById,
                                               postDetailId
                                               );

                var response = await apiExecute.GetData <PostDetailViewModel>(url, token : _token);

                return(response);
            }
            catch (Exception ex)
            {
                return(BaseResponse <PostDetailViewModel> .InternalServerError(ex));
            }
        }