JiShe.IOT.Admin/src/JiShe.IoT.Application/IoTApplicationModule.cs
2025-11-07 11:48:22 +08:00

67 lines
2.4 KiB
C#

using JiShe.IoT.CommonServices;
using JiShe.IoT.Jobs;
using JiShe.ServicePro.CTWingManagement;
using JiShe.ServicePro.DeviceManagement;
using JiShe.ServicePro.DynamicMenuManagement;
using JiShe.ServicePro.FileManagement;
using JiShe.ServicePro.FreeRedisProvider;
using JiShe.ServicePro.FreeSqlProvider;
using JiShe.ServicePro.IoTDBManagement;
using JiShe.ServicePro.OneNETManagement;
using JiShe.ServicePro.OneNETManagement.Subscribers;
using JiShe.ServicePro.TemplateManagement;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp;
namespace JiShe.IoT
{
[DependsOn(
typeof(IoTDomainModule),
typeof(IoTApplicationContractsModule),
typeof(BasicManagementApplicationModule),
typeof(NotificationManagementApplicationModule),
typeof(DataDictionaryManagementApplicationModule),
typeof(LanguageManagementApplicationModule),
typeof(TemplateManagementApplicationModule),
typeof(DynamicMenuManagementApplicationModule),
typeof(FileManagementApplicationModule),
typeof(IoTDBManagementApplicationModule),
typeof(ServiceProFreeRedisProviderModule),
typeof(CTWingManagementApplicationModule),
typeof(OneNETManagementApplicationModule),
typeof(DeviceManagementApplicationModule)
)]
public class IoTApplicationModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpAutoMapperOptions>(options =>
{
options.AddMaps<IoTApplicationModule>();
});
}
public override void PostConfigureServices(ServiceConfigurationContext context)
{
// 定时任务
ConfigureBackgroundJob(context);
}
private static void ConfigureBackgroundJob(ServiceConfigurationContext context)
{
context.Services.AddHostedService<GCCollectJob>();
}
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
var commonService = context.ServiceProvider.GetRequiredService<ICommonService>();
commonService.InitSelectTypetList();
var serviceCommunicationChannelSubscriberService = context.ServiceProvider.GetRequiredService<IServiceCommunicationChannelSubscriberService>();
serviceCommunicationChannelSubscriberService.ServiceCommunicationDeviceStatusSubscriber();
}
}
}