2024-12-19 16:07:07 +08:00
|
|
|
|
using Volo.Abp.Modularity.PlugIns;
|
|
|
|
|
|
|
|
|
|
|
|
namespace JiShe.CollectBus.Host
|
|
|
|
|
|
{
|
2025-02-24 13:47:12 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Startup
|
|
|
|
|
|
/// </summary>
|
2024-12-19 16:07:07 +08:00
|
|
|
|
public class Startup
|
|
|
|
|
|
{
|
|
|
|
|
|
private readonly IConfiguration _configuration;
|
|
|
|
|
|
|
2025-02-24 13:47:12 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Initializes a new instance of the <see cref="Startup"/> class.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="configuration">The configuration.</param>
|
2024-12-19 16:07:07 +08:00
|
|
|
|
public Startup(IConfiguration configuration)
|
|
|
|
|
|
{
|
|
|
|
|
|
_configuration = configuration;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-02-24 13:47:12 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Configures the services.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="services">The services.</param>
|
2024-12-19 16:07:07 +08:00
|
|
|
|
public void ConfigureServices(IServiceCollection services)
|
|
|
|
|
|
{
|
|
|
|
|
|
services.AddApplication<CollectBusHostModule>(options =>
|
|
|
|
|
|
{
|
|
|
|
|
|
// 加载插件,固定模式,可热插拔
|
|
|
|
|
|
options.PlugInSources.AddFolder(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Plugins"));
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-02-24 13:47:12 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Configures the specified application.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="app">The application.</param>
|
|
|
|
|
|
/// <param name="lifetime">The lifetime.</param>
|
2024-12-19 16:07:07 +08:00
|
|
|
|
public void Configure(IApplicationBuilder app, IHostApplicationLifetime lifetime)
|
|
|
|
|
|
{
|
|
|
|
|
|
app.InitializeApplication();
|
2025-03-14 13:45:29 +08:00
|
|
|
|
//await app.InitializeApplicationAsync();
|
2024-12-19 16:07:07 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|