diff --git a/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/AbpIMModule.cs b/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/AbpIMModule.cs index 1b3bc6012..5020ca431 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/AbpIMModule.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/AbpIMModule.cs @@ -1,10 +1,13 @@ -using Volo.Abp.EventBus; -using Volo.Abp.Modularity; - -namespace LINGYUN.Abp.IM -{ - [DependsOn(typeof(AbpEventBusModule))] - public class AbpIMModule : AbpModule - { - } -} +using LINGYUN.Abp.RealTime; +using Volo.Abp.EventBus; +using Volo.Abp.Modularity; + +namespace LINGYUN.Abp.IM +{ + [DependsOn( + typeof(AbpEventBusModule), + typeof(AbpRealTimeModule))] + public class AbpIMModule : AbpModule + { + } +} diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/AbpNotificationModule.cs b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/AbpNotificationModule.cs index 940a5ba86..2b210fe05 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/AbpNotificationModule.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/AbpNotificationModule.cs @@ -1,60 +1,62 @@ -using LINGYUN.Abp.Notifications.Internal; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Options; -using System; -using System.Collections.Generic; -using Volo.Abp; -using Volo.Abp.BackgroundJobs; -using Volo.Abp.BackgroundWorkers; -using Volo.Abp.Json; -using Volo.Abp.Modularity; - -namespace LINGYUN.Abp.Notifications -{ - // TODO: 需要重命名 AbpNotificationsModule - [DependsOn( - typeof(AbpBackgroundWorkersModule), - typeof(AbpBackgroundJobsAbstractionsModule), - typeof(AbpJsonModule))] - public class AbpNotificationModule : AbpModule - { - - public override void PreConfigureServices(ServiceConfigurationContext context) - { - AutoAddDefinitionProviders(context.Services); - } - - public override void OnPostApplicationInitialization(ApplicationInitializationContext context) - { - var options = context.ServiceProvider.GetRequiredService>().Value; - if (options.IsEnabled) - { - context.ServiceProvider - .GetRequiredService() - .Add( - context.ServiceProvider - .GetRequiredService() - ); - } - } - - private static void AutoAddDefinitionProviders(IServiceCollection services) - { - var definitionProviders = new List(); - - services.OnRegistred(context => - { - if (typeof(INotificationDefinitionProvider).IsAssignableFrom(context.ImplementationType)) - { - definitionProviders.Add(context.ImplementationType); - } - }); - - services.Configure(options => - { - services.ExecutePreConfiguredActions(options); - options.DefinitionProviders.AddIfNotContains(definitionProviders); - }); - } - } -} +using LINGYUN.Abp.Notifications.Internal; +using LINGYUN.Abp.RealTime; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; +using System; +using System.Collections.Generic; +using Volo.Abp; +using Volo.Abp.BackgroundJobs; +using Volo.Abp.BackgroundWorkers; +using Volo.Abp.Json; +using Volo.Abp.Modularity; + +namespace LINGYUN.Abp.Notifications +{ + // TODO: 需要重命名 AbpNotificationsModule + [DependsOn( + typeof(AbpBackgroundWorkersModule), + typeof(AbpBackgroundJobsAbstractionsModule), + typeof(AbpJsonModule), + typeof(AbpRealTimeModule))] + public class AbpNotificationModule : AbpModule + { + + public override void PreConfigureServices(ServiceConfigurationContext context) + { + AutoAddDefinitionProviders(context.Services); + } + + public override void OnPostApplicationInitialization(ApplicationInitializationContext context) + { + var options = context.ServiceProvider.GetRequiredService>().Value; + if (options.IsEnabled) + { + context.ServiceProvider + .GetRequiredService() + .Add( + context.ServiceProvider + .GetRequiredService() + ); + } + } + + private static void AutoAddDefinitionProviders(IServiceCollection services) + { + var definitionProviders = new List(); + + services.OnRegistred(context => + { + if (typeof(INotificationDefinitionProvider).IsAssignableFrom(context.ImplementationType)) + { + definitionProviders.Add(context.ImplementationType); + } + }); + + services.Configure(options => + { + services.ExecutePreConfiguredActions(options); + options.DefinitionProviders.AddIfNotContains(definitionProviders); + }); + } + } +}