public async Task <object> GetCooperation(int userId, int pageIndex, int pageSize) { MessageBase2 result = new MessageBase2(); var v = await _cooperationService.FindListAsync(pageIndex, pageSize, userId); var page = ConvertHelper.ChangeType <MessagePageBase2>(v.pageDto); var erList = new List <CooperationResultModel>(); v.dtoList.ForEach(p => { erList.Add(new CooperationResultModel() { Id = p.Id, Title = p.Title, AddTime = p.AddTime.ToString("yyyy-MM-dd HH:mm:ss"), Nickname = p.Nickname, Cover = p.Cover, City = p.City, PersonNum = p.PersonNum }); }); page.Data = erList; result.Data = page; return(result); }
public async Task <object> Get(int pageIndex, int pageSize, string sea, int cid, string city) { MessageBase2 result = new MessageBase2(); var v = await _cooperationService.FindListAsync(pageIndex, pageSize, 0, cid, city); var cr = new List <CooperationResultModel>(); v.dtoList.ForEach(p => { cr.Add(ConvertHelper.ChangeType <CooperationResultModel>(p)); }); var page = ConvertHelper.ChangeType <MessagePageBase2>(v.pageDto); page.Data = cr; result.Data = page; return(result); }