You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
122 lines
5.2 KiB
122 lines
5.2 KiB
using LINGYUN.Abp.AuditLogging.Elasticsearch;
|
|
using LINGYUN.Abp.ExceptionHandling.Emailing;
|
|
using LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore;
|
|
using LINGYUN.Abp.MultiTenancy.DbFinder;
|
|
using LINGYUN.Abp.Serilog.Enrichers.Application;
|
|
using LINGYUN.Abp.WorkflowCore.Components;
|
|
using LINGYUN.Abp.WorkflowCore.DistributedLock;
|
|
using LINGYUN.Abp.WorkflowCore.LifeCycleEvent;
|
|
using LINGYUN.Abp.WorkflowCore.Persistence.EntityFrameworkCore;
|
|
using LINGYUN.Abp.WorkflowCore.RabbitMQ;
|
|
using LINGYUN.Abp.WorkflowManagement;
|
|
using LINGYUN.Abp.WorkflowManagement.EntityFrameworkCore;
|
|
using Microsoft.AspNetCore.Builder;
|
|
using Microsoft.AspNetCore.Hosting;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.Hosting;
|
|
using System.Globalization;
|
|
using Volo.Abp;
|
|
using Volo.Abp.AspNetCore.Authentication.JwtBearer;
|
|
using Volo.Abp.AspNetCore.MultiTenancy;
|
|
using Volo.Abp.AspNetCore.Mvc;
|
|
using Volo.Abp.AspNetCore.Serilog;
|
|
using Volo.Abp.Autofac;
|
|
using Volo.Abp.Caching.StackExchangeRedis;
|
|
using Volo.Abp.EntityFrameworkCore.MySQL;
|
|
using Volo.Abp.EventBus.RabbitMq;
|
|
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;
|
|
using Volo.Abp.TenantManagement.EntityFrameworkCore;
|
|
|
|
namespace LY.MicroService.WorkflowManagement
|
|
{
|
|
[DependsOn(
|
|
typeof(AbpSerilogEnrichersApplicationModule),
|
|
typeof(AbpAuditLoggingElasticsearchModule),
|
|
typeof(AbpAspNetCoreSerilogModule),
|
|
typeof(AbpEventBusRabbitMqModule),
|
|
typeof(WorkflowManagementApplicationModule),
|
|
typeof(WorkflowManagementHttpApiModule),
|
|
typeof(WorkflowManagementEntityFrameworkCoreModule),
|
|
typeof(AbpWorkflowCoreComponentsModule),
|
|
typeof(AbpWorkflowCoreDistributedLockModule),
|
|
typeof(AbpWorkflowCoreLifeCycleEventModule),
|
|
typeof(AbpWorkflowCoreRabbitMQModule),
|
|
typeof(AbpWorkflowCorePersistenceEntityFrameworkCoreModule),
|
|
typeof(AbpEntityFrameworkCoreMySQLModule),
|
|
typeof(AbpAspNetCoreAuthenticationJwtBearerModule),
|
|
typeof(AbpEmailingExceptionHandlingModule),
|
|
typeof(AbpHttpClientIdentityModelWebModule),
|
|
typeof(AbpAspNetCoreMultiTenancyModule),
|
|
typeof(AbpDbFinderMultiTenancyModule),
|
|
typeof(AbpFeatureManagementEntityFrameworkCoreModule),
|
|
typeof(AbpPermissionManagementEntityFrameworkCoreModule),
|
|
typeof(AbpSettingManagementEntityFrameworkCoreModule),
|
|
typeof(AbpTenantManagementEntityFrameworkCoreModule),
|
|
typeof(AbpLocalizationManagementEntityFrameworkCoreModule),
|
|
typeof(AbpCachingStackExchangeRedisModule),
|
|
typeof(AbpAspNetCoreMvcModule),
|
|
typeof(AbpSwashbuckleModule),
|
|
typeof(AbpAutofacModule)
|
|
)]
|
|
public partial class WorkflowManagementHttpApiHostModule : AbpModule
|
|
{
|
|
public override void PreConfigureServices(ServiceConfigurationContext context)
|
|
{
|
|
PreConfigureApp();
|
|
}
|
|
|
|
public override void ConfigureServices(ServiceConfigurationContext context)
|
|
{
|
|
var hostingEnvironment = context.Services.GetHostingEnvironment();
|
|
var configuration = hostingEnvironment.BuildConfiguration();
|
|
|
|
ConfigureDbContext();
|
|
ConfigureLocalization();
|
|
ConfigureJsonSerializer();
|
|
ConfigureExceptionHandling();
|
|
ConfigureVirtualFileSystem();
|
|
ConfigureCaching(configuration);
|
|
ConfigureAuditing(configuration);
|
|
ConfigureMultiTenancy(configuration);
|
|
ConfigureSwagger(context.Services);
|
|
ConfigureDistributedLock(context.Services, configuration);
|
|
ConfigureSecurity(context.Services, configuration, hostingEnvironment.IsDevelopment());
|
|
}
|
|
|
|
public override void OnApplicationInitialization(ApplicationInitializationContext context)
|
|
{
|
|
var app = context.GetApplicationBuilder();
|
|
var env = context.GetEnvironment();
|
|
|
|
app.UseStaticFiles();
|
|
app.UseCorrelationId();
|
|
app.UseRouting();
|
|
app.UseCors();
|
|
app.UseAuthentication();
|
|
app.UseJwtTokenMiddleware();
|
|
app.UseMultiTenancy();
|
|
app.UseAbpRequestLocalization(options => options.SetDefaultCulture(CultureInfo.CurrentCulture.Name));
|
|
app.UseAuthorization();
|
|
app.UseSwagger();
|
|
app.UseAbpSwaggerUI(options =>
|
|
{
|
|
options.SwaggerEndpoint("/swagger/v1/swagger.json", "Support APP API");
|
|
|
|
var configuration = context.GetConfiguration();
|
|
options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]);
|
|
options.OAuthClientSecret(configuration["AuthServer:SwaggerClientSecret"]);
|
|
options.OAuthScopes("WorkflowManagement");
|
|
});
|
|
app.UseAuditing();
|
|
app.UseAbpSerilogEnrichers();
|
|
app.UseConfiguredEndpoints();
|
|
|
|
SeedData(context);
|
|
}
|
|
}
|
|
}
|
|
|