示例#1
0
        public JSONResult <List <New> > GetNesList(string kw, int pageIndex, int pageSize)
        {
            return(new BaseJsonResult().UnifiedFucn(() =>
            {
                var model = new JSONResult <List <New> >();
                model.Success = true;
                if (pageIndex == 0)
                {
                    pageIndex = 1;
                }
                if (pageSize == 0)
                {
                    pageSize = 8;
                }
                NewService service = new NewService();
                var newList = service.GetNewListByPage(kw, pageIndex, pageSize);
                if (newList.Count > 0)
                {
                    model.ret = 0;
                    model.Result = "获取数据成功";
                    model.Content = newList;
                }
                else
                {
                    model.ret = 5;
                    model.Result = "没有更多记录";
                    model.Content = newList;
                }

                return model;
            }));
        }