/// <summary> /// 应用加载 /// </summary> public override void Load() { base.Load(); TagUrlGetterManager.RegisterGetter(TenantTypeIds.Instance().Topic(), new TopicTagUrlGetter()); //注册专题计数服务 CountService countService = new CountService(TenantTypeIds.Instance().Topic()); countService.RegisterCounts();//注册计数服务 countService.RegisterCountPerDay();//需要统计阶段计数时,需注册每日计数服务 countService.RegisterStageCount(CountTypes.Instance().HitTimes(), 7); OwnerDataSettings.RegisterStatisticsDataKeys(TenantTypeIds.Instance().User() , OwnerDataKeys.Instance().CreatedTopicCount() , OwnerDataKeys.Instance().JoinedTopicCount()); //添加应用管理员角色 ApplicationAdministratorRoleNames.Add(applicationId, new List<string> { "TopicAdministrator" }); }
/// <summary> /// 应用加载 /// </summary> public override void Load() { base.Load(); //注册文章计数服务 CountService countService = new CountService(TenantTypeIds.Instance().BlogThread()); //注册计数服务 countService.RegisterCounts(); //需要统计阶段计数时,需注册每日计数服务 countService.RegisterCountPerDay(); //注册文章浏览计数服务 countService.RegisterStageCount(CountTypes.Instance().HitTimes(), 7); //注册用户计数服务 OwnerDataSettings.RegisterStatisticsDataKeys(TenantTypeIds.Instance().User(), OwnerDataKeys.Instance().ThreadCount()); //标签云中标签的链接 TagUrlGetterManager.RegisterGetter(TenantTypeIds.Instance().BlogThread(), new BlogTagUrlGetter()); //添加应用管理员角色 ApplicationAdministratorRoleNames.Add(ApplicationIds.Instance().Blog(), new List<string> { "BlogAdministrator" }); }
/// <summary> /// 应用加载 /// </summary> public override void Load() { base.Load(); //注册日志Rss浏览计数服务 CountService countService = new CountService(TenantTypeIds.Instance().Microblog()); countService.RegisterCounts();//注册计数服务 countService.RegisterCountPerDay();//需要统计阶段计数时,需注册每日计数服务 countService.RegisterStageCount(CountTypes.Instance().CommentCount(), 1); //注册微博用户计数服务 List<string> tenantTypeIds = new List<string>() { TenantTypeIds.Instance().User(), TenantTypeIds.Instance().Group() }; OwnerDataSettings.RegisterStatisticsDataKeys(tenantTypeIds, OwnerDataKeys.Instance().ThreadCount()); TagUrlGetterManager.RegisterGetter(TenantTypeIds.Instance().Microblog(), new MicroblogTagUrlGetter()); //添加应用管理员角色 ApplicationAdministratorRoleNames.Add(ApplicationIds.Instance().Microblog(), new List<string> { "MicroblogAdministrator" }); }
/// <summary> /// 应用加载 /// </summary> public override void Load() { base.Load(); //注册帖吧计数服务 CountService countService = new CountService(TenantTypeIds.Instance().BarSection()); countService.RegisterCounts();//注册计数服务 countService.RegisterCountPerDay();//需要统计阶段计数时,需注册每日计数服务 countService.RegisterStageCount(CountTypes.Instance().ThreadAndPostCount(), 1); //注册帖子计数服务 countService = new CountService(TenantTypeIds.Instance().BarThread()); countService.RegisterCounts();//注册计数服务 countService.RegisterCountPerDay();//需要统计阶段计数时,需注册每日计数服务 countService.RegisterStageCount(CountTypes.Instance().HitTimes(), 1, 7); //注册贴吧用户计数服务 List<string> tenantTypeIds = new List<string>() { TenantTypeIds.Instance().User(), TenantTypeIds.Instance().Group() }; OwnerDataSettings.RegisterStatisticsDataKeys(tenantTypeIds , OwnerDataKeys.Instance().ThreadCount() , OwnerDataKeys.Instance().PostCount() , OwnerDataKeys.Instance().FollowSectionCount()); TagUrlGetterManager.RegisterGetter(TenantTypeIds.Instance().BarThread(), new BarTagUrlGetter()); TagUrlGetterManager.RegisterGetter(TenantTypeIds.Instance().Group(), new BarTagUrlGetter()); //添加应用管理员角色 ApplicationAdministratorRoleNames.Add(ApplicationIds.Instance().Bar(), new List<string> { "BarAdministrator" }); }
/// <summary> /// 初始化应用程序,加载基础数据 /// </summary> private static void InitializeApplication() { //加载应用 ApplicationService applicationService = DIContainer.Resolve<ApplicationService>(); foreach (var application in applicationService.GetAll()) { if (application.Config == null) continue; application.Config.Load(); } //注册事件处理程序 IEnumerable<IEventMoudle> eventMoudles = DIContainer.Resolve<IEnumerable<IEventMoudle>>(); foreach (var eventMoudle in eventMoudles) { eventMoudle.RegisterEventHandler(); } //注册皮肤选择器 ThemeService.RegisterThemeResolver("Channel", new ChannelThemeResolver()); ThemeService.RegisterThemeResolver("UserSpace", new UserSpaceThemeResolver()); ThemeService.RegisterThemeResolver("ControlPanel", new ControlPanelThemeResolver()); //初始化敏感词过滤 SensitiveWordService service = DIContainer.Resolve<SensitiveWordService>(); IEnumerable<SensitiveWord> words = service.Gets(); if (words != null) { WordFilter.Add(WordFilterTypeIds.Instance().SensitiveWord(), words.ToDictionary(n => n.Word, n => n.Replacement)); } //注册标题图的配置 TenantLogoSettings.RegisterSettings(LogoConfigManager.Instance().GetAllLogoConfigs()); //初始化第三方帐号获取器 ThirdAccountGetterFactory.InitializeAll(); //注册标签URL获取管理器 TagUrlGetterManager.RegisterGetter(TenantTypeIds.Instance().User(), new UserTagUrlGetter()); //注册请求类型 InvitationType.Register(new InvitationType { Key = InvitationTypeKeys.Instance().InviteFollow(), Name = "求关注", Description = "" }); //注册搜索相关的计数服务 CountService countService = new CountService(TenantTypeIds.Instance().Search()); countService.RegisterCounts(); //注册计数服务 countService.RegisterCountPerDay(); //需要统计阶段计数时,需注册每日计数服务 countService.RegisterStageCount(CountTypes.Instance().SearchCount(), 7); //阶段计数为:最近7天搜索计数 //注册用户相关的计数服务 CountService userCountService = new CountService(TenantTypeIds.Instance().User()); userCountService.RegisterCounts(); //注册计数服务 userCountService.RegisterCountPerDay(); //需要统计阶段计数时,需注册每日计数服务 userCountService.RegisterStageCount(CountTypes.Instance().ReputationPointsCounts(), 7); //阶段计数为:最近7天威望计数 userCountService.RegisterStageCount(CountTypes.Instance().HitTimes(), 7); //阶段计数为:最近7天浏览计数 //注册标签相关的计数服务 CountService perDayCountService = new CountService(TenantTypeIds.Instance().Tag()); perDayCountService.RegisterCounts(); //注册计数服务 perDayCountService.RegisterCountPerDay(); //需要统计阶段计数时,需注册每日计数服务 perDayCountService.RegisterStageCount(CountTypes.Instance().ItemCounts(), 1, 7); //阶段计数为:最近1,7天讨论次数计数 //注册附件相关的计数服务 CountService attachmentCountService = new CountService(TenantTypeIds.Instance().Attachment()); attachmentCountService.RegisterCounts();//注册计数服务 //注册站点公告相关的计数服务 CountService announcementCountService = new CountService(TenantTypeIds.Instance().Announcement()); announcementCountService.RegisterCounts();//注册计数服务 announcementCountService.RegisterCountPerDay();//需要统计阶段计数时,需注册每日计数服务 announcementCountService.RegisterStageCount(CountTypes.Instance().HitTimes(), 7);//阶段计数为:最近7天浏览计数 //注册邮箱相关计数 CountService emailCountService = new CountService(TenantTypeIds.Instance().Email()); emailCountService.RegisterCounts();//注册计数服务 emailCountService.RegisterCountPerDay(); //需要统计阶段计数时,需注册每日计数服务 emailCountService.RegisterStageCount(CountTypes.Instance().UseCount(), 1); //阶段计数为:最近1,7天讨论次数计数 new EmailService().ReLoadSmtpSettings(); //启动定时任务 TaskSchedulerFactory.GetScheduler().Start(); }
/// <summary> /// 应用加载 /// </summary> public override void Load() { base.Load(); //注册计数服务 CountService countService = new CountService(TenantTypeIds.Instance().ContentItem()); countService.RegisterCounts(); countService.RegisterCountPerDay(); countService.RegisterStageCount(CountTypes.Instance().HitTimes(), 7); countService.RegisterStageCount(CountTypes.Instance().CommentCount(), 7); countService = new CountService(TenantTypeIds.Instance().ContentAttachment()); countService.RegisterCounts(); //注册用户计数服务(用于内容计数) OwnerDataSettings.RegisterStatisticsDataKeys(TenantTypeIds.Instance().User(), OwnerDataKeys.Instance().ContributeCount()); //注册标签云标签链接接口实现 TagUrlGetterManager.RegisterGetter(TenantTypeIds.Instance().ContentItem(), new CmsTagUrlGetter()); //添加应用管理员角色 ApplicationAdministratorRoleNames.Add(applicationId, new List<string> { "CMSAdministrator" }); }