예제 #1
0
        public async Task <ApiResult <PageViewModel <BlogArticleWebModel> > > GetPage(int pageIndex = 1, int pageSize = 10)
        {
            var r = new ApiResult <PageViewModel <BlogArticleWebModel> >();

            try
            {
                r.msg  = "查询成功";
                r.data = _mapper.Map <List <BlogArticleWebModel> >(await _blogArticleServices.GetPage(pageIndex, pageSize)).AsPageViewModel(pageIndex, pageSize);
            }
            catch (Exception ex)
            {
                r.status = 500;
                r.msg    = ex.Message;
            }
            return(r);
        }