Esempio n. 1
0
        public async Task <InfoModel <TableOutputReportInfo> > GetListPageCreateID([FromBody] TableOutputReportInput model)
        {
            var list = await ContentContext.GetListPageCreateID(
                HttpContext.RequestServices,
                model.PageInfo,
                (await UserInfoForLogin).GetKey(),
                model.Status);

            return(new InfoModel <TableOutputReportInfo>()
            {
                Data = new TableOutputReportInfo()
                {
                    Page = model.PageInfo,
                    ReportList = list.ConvertAll(T => {
                        return new OutPutContentInfoItem()
                        {
                            Introduce = T.GetEntity().Introduce,
                            Content = T.GetEntity().Content.HtmlDecode(),
                            ContentId = T.GetKey(),
                            CreateTiem = T.GetEntity().CreateDate.ToString("yyyy-MM-dd hh:mm:ss"),
                            HeadImage = new TempFileInfo()
                            {
                                ServerDirPath = T.GetDownFileDir(),
                                ServerFileName = T.GetEntity().Image,
                            },
                            Title = T.GetEntity().Title,
                            StstusName = HttpContext.RequestServices.GetDataTypeForConstant <ContentStatusType>().FindDataTypeForValue(T.GetEntity().Status)
                        };
                    }),
                    ExamineList = HttpContext.RequestServices.GetDataTypeForConstant <ContentStatusType>().DataType.ConvertAll(T =>
                    {
                        return new TypeForName <int, string>()
                        {
                            Id = T.Id,
                            Name = T.Value
                        };
                    }),
                },
            });
        }