public ServiceResult <List <ArticleModel> > List(int pageIndex = 1, int pageSize = 10) { var result = new ServiceResult <List <ArticleModel> >(); var list = new ArticleComponent().List(pageSize, pageIndex, ArticleAccountType.FiiiPos, this.GetMerchantAccountId(), this.IsZH()); result.Data = list.Select(a => new ArticleModel { Id = a.Id, Timestamp = a.CreateTime.ToUnixTime().ToString(), Title = a.Title, Read = a.Read, Intro = a.Intro, Type = a.Type }).ToList(); return(result); }
public ServiceResult <ArticleListOM> List(ArticleListIM im) { var list = new ArticleComponent().List(im.PageSize, im.PageIndex + 1, Entities.ArticleAccountType.FiiiPay, this.GetUser().Id, this.IsZH()); return(new ServiceResult <ArticleListOM> { Data = new ArticleListOM { List = list.Select(a => new ArticleListOMItem { Id = a.Id, Intro = a.Intro, Read = a.Read, Timestamp = a.CreateTime.ToUnixTime().ToString(), Title = a.Title, Type = a.Type }).ToList() } }); }