예제 #1
0
        public PageResult <PickUpListDTO> GetRealUserPickUpList(int page, int rows, int uId, PickUpTypeEnum pickType)
        {
            var rtn        = new PageResult <PickUpListDTO>();
            var pickUpList = letterDal.PickUpListByParam(uId, page, rows, pickType);

            if (pickUpList != null && pickUpList.Item1.NotEmpty())
            {
                var pickUps = new List <PickUpListDTO>();
                foreach (var item in pickUpList.Item1)
                {
                    var pickUpUser = userBiz.LetterUserByUId(item.MomentUId);
                    if (pickUpUser == null)
                    {
                        continue;
                    }
                    var moment = letterDal.GetMoment(item.MomentId);
                    if (moment == null)
                    {
                        continue;
                    }
                    var dto = new PickUpListDTO()
                    {
                        PickUpId    = item.PickUpId,
                        UId         = item.MomentUId,
                        HeadImgPath = pickUpUser.HeadPhotoPath.GetImgPath(),
                        NickName    = pickUpUser.NickName,
                        TextContent = moment.TextContent,
                        ImgContent  = moment.ImgContent.GetImgPath(),
                        CreateTime  = moment.CreateTime.GetDateDesc()
                    };

                    pickUps.Add(dto);
                }
                rtn.Rows  = pickUps;
                rtn.Total = pickUpList.Item2;
            }
            return(rtn);
        }