2025-04-25 14:42:11 +08:00
|
|
|
|
using JiShe.CollectBus.Protocol.Interfaces;
|
2025-04-11 17:12:29 +08:00
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
2025-05-28 16:45:30 +08:00
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
|
|
using System.Reflection;
|
2025-04-11 17:12:29 +08:00
|
|
|
|
using Volo.Abp;
|
|
|
|
|
|
using Volo.Abp.Modularity;
|
|
|
|
|
|
|
|
|
|
|
|
namespace JiShe.CollectBus.Protocol.Test
|
|
|
|
|
|
{
|
2025-04-22 21:01:28 +08:00
|
|
|
|
public class JiSheCollectBusTestProtocolModule : AbpModule
|
2025-04-11 17:12:29 +08:00
|
|
|
|
{
|
|
|
|
|
|
public override void ConfigureServices(ServiceConfigurationContext context)
|
|
|
|
|
|
{
|
2025-04-24 00:34:00 +08:00
|
|
|
|
Console.WriteLine("TestProtocolPlugin ConfigureServices");
|
2025-04-11 17:12:29 +08:00
|
|
|
|
context.Services.AddKeyedSingleton<IProtocolPlugin, TestProtocolPlugin>(nameof(TestProtocolPlugin));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-04-22 21:01:28 +08:00
|
|
|
|
public override async Task OnApplicationInitializationAsync(ApplicationInitializationContext context)
|
2025-04-11 17:12:29 +08:00
|
|
|
|
{
|
2025-04-24 21:01:01 +08:00
|
|
|
|
Console.WriteLine("TestProtocolPlugin OnApplicationInitializationAsync");
|
2025-04-11 17:12:29 +08:00
|
|
|
|
var protocol = context.ServiceProvider.GetRequiredKeyedService<IProtocolPlugin>(nameof(TestProtocolPlugin));
|
2025-04-22 21:01:28 +08:00
|
|
|
|
await protocol.LoadAsync();
|
2025-04-11 17:12:29 +08:00
|
|
|
|
}
|
2025-04-24 21:01:01 +08:00
|
|
|
|
|
|
|
|
|
|
public override void OnApplicationShutdown(ApplicationShutdownContext context)
|
|
|
|
|
|
{
|
|
|
|
|
|
Console.WriteLine("TestProtocolPlugin OnApplicationShutdown");
|
|
|
|
|
|
base.OnApplicationShutdown(context);
|
|
|
|
|
|
}
|
2025-04-11 17:12:29 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|