using LINGYUN.Abp.AspNetCore.HttpOverrides; using LINGYUN.Abp.AspNetCore.Mvc.Wrapper; using LINGYUN.Abp.AspNetCore.Session; using LINGYUN.Abp.AuditLogging.Elasticsearch; using LINGYUN.Abp.AuditLogging.IP.Location; using LINGYUN.Abp.Authorization.OrganizationUnits; using LINGYUN.Abp.BackgroundTasks.DistributedLocking; using LINGYUN.Abp.BackgroundTasks.Quartz; using LINGYUN.Abp.AspNetCore.Authentication; using LINGYUN.Abp.Dapr.Client.Wrapper; using LINGYUN.Abp.Dynamic.Definitions; using LINGYUN.Abp.Emailing.Platform; using LINGYUN.Abp.EventBus.CAP; using LINGYUN.Abp.ExceptionHandling.Emailing; using LINGYUN.Abp.Http.Client.Wrapper; using LINGYUN.Abp.IP2Region; using LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore; using LINGYUN.Abp.Quartz.MySqlInstaller; using LINGYUN.Abp.Saas.EntityFrameworkCore; using LINGYUN.Abp.Serilog.Enrichers.Application; using LINGYUN.Abp.Serilog.Enrichers.UniqueId; using LINGYUN.Abp.Sms.Platform; using LINGYUN.Abp.TaskManagement.EntityFrameworkCore; using LINGYUN.Abp.Telemetry.OpenTelemetry; using LINGYUN.Abp.Telemetry.SkyWalking; using LINGYUN.Abp.Webhooks.EventBus; using LINGYUN.Abp.Webhooks.Identity; using LINGYUN.Abp.Webhooks.Saas; using LINGYUN.Abp.WebhooksManagement; using LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore; using LINGYUN.Abp.MicroService.WebhookService.EntityFrameworkCore; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Volo.Abp; using Volo.Abp.AspNetCore.Authentication.JwtBearer; using Volo.Abp.AspNetCore.MultiTenancy; using Volo.Abp.AspNetCore.Serilog; using Volo.Abp.Autofac; using Volo.Abp.Caching.StackExchangeRedis; using Volo.Abp.DistributedLocking; using Volo.Abp.FeatureManagement.EntityFrameworkCore; using Volo.Abp.Http.Client.IdentityModel.Web; using Volo.Abp.Modularity; using Volo.Abp.PermissionManagement.EntityFrameworkCore; using Volo.Abp.SettingManagement.EntityFrameworkCore; using Volo.Abp.Swashbuckle; namespace LINGYUN.Abp.MicroService.WebhookService; [DependsOn( typeof(AbpSerilogEnrichersApplicationModule), typeof(AbpSerilogEnrichersUniqueIdModule), typeof(AbpAuditLoggingElasticsearchModule), typeof(AbpAuditLoggingIPLocationModule), typeof(AbpIP2RegionModule), typeof(AbpAspNetCoreSerilogModule), typeof(WebhooksManagementApplicationModule), typeof(WebhooksManagementHttpApiModule), typeof(WebhooksManagementEntityFrameworkCoreModule), typeof(AbpWebhooksIdentityModule), typeof(AbpWebhooksSaasModule), typeof(AbpWebhooksEventBusModule), typeof(AbpBackgroundTasksQuartzModule), typeof(AbpBackgroundTasksDistributedLockingModule), typeof(AbpQuartzMySqlInstallerModule), typeof(TaskManagementEntityFrameworkCoreModule), typeof(AbpSaasEntityFrameworkCoreModule), typeof(AbpFeatureManagementEntityFrameworkCoreModule), typeof(AbpPermissionManagementEntityFrameworkCoreModule), typeof(AbpSettingManagementEntityFrameworkCoreModule), typeof(AbpLocalizationManagementEntityFrameworkCoreModule), typeof(WebhookServiceMigrationsEntityFrameworkCoreModule), typeof(AbpAspNetCoreAuthenticationJwtBearerModule), typeof(AbpAuthorizationOrganizationUnitsModule), typeof(AbpEmailingExceptionHandlingModule), typeof(AbpCAPEventBusModule), typeof(AbpHttpClientIdentityModelWebModule), typeof(AbpAspNetCoreMultiTenancyModule), typeof(AbpCachingStackExchangeRedisModule), typeof(AbpDistributedLockingModule), typeof(AbpSwashbuckleModule), typeof(AbpHttpClientWrapperModule), typeof(AbpDaprClientWrapperModule), typeof(AbpAspNetCoreAuthenticationModule), typeof(AbpEmailingPlatformModule), typeof(AbpSmsPlatformModule), typeof(AbpTelemetryOpenTelemetryModule), typeof(AbpTelemetrySkyWalkingModule), typeof(AbpAspNetCoreSessionModule), typeof(AbpAspNetCoreMvcWrapperModule), typeof(AbpAspNetCoreHttpOverridesModule), typeof(AbpDynamicDefinitionsModule), typeof(AbpAutofacModule) )] public partial class WebhookServiceModule : AbpModule { public override void PreConfigureServices(ServiceConfigurationContext context) { var configuration = context.Services.GetConfiguration(); PreConfigureWrapper(); PreConfigureFeature(); PreForwardedHeaders(); PreConfigureApp(configuration); PreConfigureCAP(configuration); PreConfigureQuartz(configuration); } public override void ConfigureServices(ServiceConfigurationContext context) { var hostingEnvironment = context.Services.GetHostingEnvironment(); var configuration = context.Services.GetConfiguration(); ConfigureWrapper(); ConfigureLocalization(); ConfigureExceptionHandling(); ConfigureVirtualFileSystem(); ConfigureFeatureManagement(); ConfigureSettingManagement(); ConfigurePermissionManagement(); ConfigureTiming(configuration); ConfigureCaching(configuration); ConfigureAuditing(configuration); ConfigureIdentity(configuration); ConfigureMultiTenancy(configuration); ConfigureWebhooks(context.Services); ConfigureJsonSerializer(configuration); ConfigureMvc(context.Services, configuration); ConfigureCors(context.Services, configuration); if (hostingEnvironment.IsDevelopment()) { ConfigureSwagger(context.Services, configuration); } ConfigureDistributedLock(context.Services, configuration); ConfigureBackgroundTasks(context.Services, configuration); ConfigureSecurity(context.Services, configuration, hostingEnvironment.IsDevelopment()); } public override void OnApplicationInitialization(ApplicationInitializationContext context) { var app = context.GetApplicationBuilder(); var env = context.GetEnvironment(); app.UseForwardedHeaders(); app.UseMapRequestLocalization(); app.UseCorrelationId(); app.MapAbpStaticAssets(); app.UseRouting(); app.UseCors(); app.UseAuthentication(); app.UseJwtTokenMiddleware(); app.UseMultiTenancy(); app.UseDynamicClaims(); app.UseAuthorization(); if (env.IsDevelopment()) { app.UseSwagger(); app.UseAbpSwaggerUI(options => { options.SwaggerEndpoint("/swagger/v1/swagger.json", "Support Webhook Service API"); var configuration = context.GetConfiguration(); options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]); options.OAuthScopes(configuration["AuthServer:Audience"]); }); } app.UseAuditing(); app.UseAbpSerilogEnrichers(); app.UseConfiguredEndpoints(); } }