Ejemplo n.º 1
0
        public static async Task <Tuple <long, long> > PCHelpEnsure(
            IServiceInstanceManager sim,
            long?ScopeId,
            IContentManager ContentManger,
            IFilePathResolver FilePathResolver,
            IDocumentManager DocManager,
            IDocumentCategoryManager CatManager
            )
        {
            var re = await DocManager.DocEnsureFromFiles(
                CatManager,
                //"pc-help",
                null,
                FilePathResolver.Resolve($"root://StaticResources/帮助文档/PC文档")
                );

            await sim.UpdateSetting <HygouSetting>(
                ScopeId,
                s =>
            {
                s.PCHelpCenterDefaultDocId = re[0].Children[0].Id;
            });

            var tail_doc_list = await ContentManger.ContentEnsure(
                "PC页面尾部文档列表",
                "PC页面尾部文档列表",
                null,
                re.Select(cat =>
                          new ContentItem {
                Title1 = cat.Name,
                Items = cat.Children.Select(doc =>
                                            new ContentItem {
                    Title1 = doc.Name, Uri = $"/help/doc/{doc.Id}"
                }
                                            ).ToArray()
            }
                          ).Take(4).ToArray()
                );

            var tail_link_list = await ContentManger.ContentEnsure(
                "PC页面尾部链接列表",
                "PC页面尾部链接列表",
                null,
                re.Last().Children.Select(doc =>
                                          new ContentItem {
                Title1 = doc.Name, Uri = $"/help/doc/{doc.Id}"
            }
                                          ).ToArray()
                );

            await sim.UpdateSetting <FriendlyContentSetting>(
                ScopeId,
                s =>
            {
                s.PCHomeTailMenuId = tail_doc_list.Id;
            });

            return(Tuple.Create(tail_doc_list.Id, tail_link_list.Id));
        }
Ejemplo n.º 2
0
 public static async Task MobileHelpEnsure(
     IFilePathResolver FilePathResolver,
     IDocumentManager DocManager,
     IDocumentCategoryManager CatManager
     )
 {
     await DocManager.DocEnsureFromFiles(
         CatManager,
         null,
         FilePathResolver.Resolve($"root://StaticResources/帮助文档/手机文档"),
         null
         );
 }