Exemplo n.º 1
0
        public async Task <ApiResult <PageViewModel <TestWebModel> > > GetPage(int pageIndex = 1, int pageSize = 10)
        {
            var r = new ApiResult <PageViewModel <TestWebModel> >();

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