using Lion.AbpPro.AspNetCore; using Microsoft.OpenApi; using Swashbuckle.AspNetCore.SwaggerUI; using Volo.Abp.AspNetCore.MultiTenancy; using Volo.Abp.EntityFrameworkCore.PostgreSql; namespace Lion.AbpPro.DataDictionaryManagement { [DependsOn( typeof(DataDictionaryManagementApplicationModule), typeof(DataDictionaryManagementEntityFrameworkCoreModule), typeof(DataDictionaryManagementHttpApiModule), typeof(AbpAspNetCoreMultiTenancyModule), typeof(AbpAutofacModule), typeof(AbpCachingStackExchangeRedisModule), typeof(AbpEntityFrameworkCorePostgreSqlModule), typeof(AbpAuditLoggingEntityFrameworkCoreModule), typeof(AbpPermissionManagementEntityFrameworkCoreModule), typeof(AbpSettingManagementEntityFrameworkCoreModule), typeof(AbpAspNetCoreSerilogModule), typeof(AbpProAspNetCoreModule) )] public class DataDictionaryManagementHttpApiHostModule : AbpModule { public override void PreConfigureServices(ServiceConfigurationContext context) { AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); } public override void ConfigureServices(ServiceConfigurationContext context) { context.Services .AddAbpProAuditLog() .AddAbpProJwtBearer() .AddAbpProMultiTenancy() .AddAbpProHealthChecks() .AddAbpProTenantResolvers() .AddAbpProLocalization() .AddAbpProExceptions() .AddAbpProSwagger("DataDictionaryManagement"); } public override void OnApplicationInitialization(ApplicationInitializationContext context) { var app = context.GetApplicationBuilder(); app.UseCorrelationId(); app.UseStaticFiles(); app.UseRouting(); app.UseCors(); app.UseAuthentication(); app.UseMultiTenancy(); app.UseAbpRequestLocalization(); app.UseAuthorization(); app.UseSwagger(); app.UseSwaggerUI(options => { options.SwaggerEndpoint("/swagger/DataDictionaryManagement/swagger.json", "DataDictionaryManagement API"); options.DocExpansion(DocExpansion.None); options.DefaultModelsExpandDepth(-1); }); app.UseAuditing(); app.UseAbpSerilogEnrichers(); app.UseConfiguredEndpoints(); } } }