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.
157 lines
6.5 KiB
157 lines
6.5 KiB
using LINGYUN.Abp.AspNetCore.HttpOverrides;
|
|
using LINGYUN.Abp.AspNetCore.Mvc.Localization;
|
|
using LINGYUN.Abp.AspNetCore.Mvc.Wrapper;
|
|
using LINGYUN.Abp.AuditLogging.Elasticsearch;
|
|
using LINGYUN.Abp.Authorization.OrganizationUnits;
|
|
using LINGYUN.Abp.Claims.Mapping;
|
|
using LINGYUN.Abp.Data.DbMigrator;
|
|
using LINGYUN.Abp.EventBus.CAP;
|
|
using LINGYUN.Abp.ExceptionHandling.Emailing;
|
|
using LINGYUN.Abp.Features.LimitValidation.Redis;
|
|
using LINGYUN.Abp.Identity.Session.AspNetCore;
|
|
using LINGYUN.Abp.Localization.CultureMap;
|
|
using LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore;
|
|
using LINGYUN.Abp.MicroService.PlatformService.BackgroundWorkers;
|
|
using LINGYUN.Abp.Notifications;
|
|
using LINGYUN.Abp.OssManagement;
|
|
using LINGYUN.Abp.OssManagement.Aliyun;
|
|
using LINGYUN.Abp.OssManagement.FileSystem;
|
|
using LINGYUN.Abp.OssManagement.Imaging;
|
|
using LINGYUN.Abp.OssManagement.Minio;
|
|
using LINGYUN.Abp.OssManagement.Nexus;
|
|
using LINGYUN.Abp.OssManagement.SettingManagement;
|
|
using LINGYUN.Abp.OssManagement.Tencent;
|
|
using LINGYUN.Abp.Saas.EntityFrameworkCore;
|
|
using LINGYUN.Abp.Serilog.Enrichers.Application;
|
|
using LINGYUN.Abp.Serilog.Enrichers.UniqueId;
|
|
using LINGYUN.Abp.Sms.Aliyun;
|
|
using LINGYUN.Platform;
|
|
using LINGYUN.Platform.EntityFrameworkCore;
|
|
using LINGYUN.Platform.HttpApi;
|
|
using Microsoft.Extensions.Options;
|
|
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.BackgroundWorkers;
|
|
using Volo.Abp.Caching.StackExchangeRedis;
|
|
using Volo.Abp.FeatureManagement.EntityFrameworkCore;
|
|
using Volo.Abp.Http.Client;
|
|
using Volo.Abp.Http.Client.IdentityModel.Web;
|
|
using Volo.Abp.Identity;
|
|
using Volo.Abp.Imaging;
|
|
using Volo.Abp.MailKit;
|
|
using Volo.Abp.Modularity;
|
|
using Volo.Abp.PermissionManagement.EntityFrameworkCore;
|
|
using Volo.Abp.SettingManagement.EntityFrameworkCore;
|
|
using Volo.Abp.Swashbuckle;
|
|
using Volo.Abp.Threading;
|
|
|
|
namespace LINGYUN.Abp.MicroService.PlatformService;
|
|
|
|
[DependsOn(
|
|
typeof(AbpSerilogEnrichersApplicationModule),
|
|
typeof(AbpSerilogEnrichersUniqueIdModule),
|
|
typeof(AbpAspNetCoreSerilogModule),
|
|
typeof(AbpAuditLoggingElasticsearchModule),
|
|
typeof(AbpAspNetCoreMultiTenancyModule),
|
|
typeof(AbpAspNetCoreMvcLocalizationModule),
|
|
typeof(AbpOssManagementAliyunModule), // 阿里云存储提供者模块
|
|
typeof(AbpOssManagementTencentModule), // 腾讯云存储提供者模块
|
|
typeof(AbpOssManagementNexusModule), // Nexus存储提供者模块
|
|
typeof(AbpOssManagementMinioModule), // Minio存储提供者模块
|
|
typeof(AbpOssManagementFileSystemModule),// 本地文件系统提供者模块
|
|
typeof(AbpOssManagementImagingModule), // 对象存储图形处理模块
|
|
typeof(AbpOssManagementApplicationModule),
|
|
typeof(AbpOssManagementHttpApiModule),
|
|
typeof(AbpOssManagementSettingManagementModule),
|
|
typeof(AbpImagingImageSharpModule),
|
|
typeof(PlatformApplicationModule),
|
|
typeof(PlatformHttpApiModule),
|
|
typeof(PlatformEntityFrameworkCoreModule),
|
|
typeof(AbpIdentityHttpApiClientModule),
|
|
typeof(AbpHttpClientIdentityModelWebModule),
|
|
typeof(AbpFeatureManagementEntityFrameworkCoreModule),
|
|
typeof(AbpSaasEntityFrameworkCoreModule),
|
|
typeof(AbpSettingManagementEntityFrameworkCoreModule),
|
|
typeof(AbpPermissionManagementEntityFrameworkCoreModule),
|
|
typeof(AbpLocalizationManagementEntityFrameworkCoreModule),
|
|
typeof(PlatformServiceMigrationsEntityFrameworkCoreModule),
|
|
typeof(AbpDataDbMigratorModule),
|
|
typeof(AbpAspNetCoreAuthenticationJwtBearerModule),
|
|
typeof(AbpAuthorizationOrganizationUnitsModule),
|
|
typeof(AbpNotificationsModule),
|
|
typeof(AbpEmailingExceptionHandlingModule),
|
|
typeof(AbpCAPEventBusModule),
|
|
typeof(AbpFeaturesValidationRedisModule),
|
|
// typeof(AbpFeaturesClientModule),// 当需要客户端特性限制时取消注释此模块
|
|
// typeof(AbpFeaturesValidationRedisClientModule),// 当需要客户端特性限制时取消注释此模块
|
|
typeof(AbpCachingStackExchangeRedisModule),
|
|
typeof(AbpLocalizationCultureMapModule),
|
|
typeof(AbpIdentitySessionAspNetCoreModule),
|
|
typeof(AbpHttpClientModule),
|
|
typeof(AbpMailKitModule),
|
|
typeof(AbpAliyunSmsModule),
|
|
typeof(AbpAspNetCoreMvcWrapperModule),
|
|
typeof(AbpClaimsMappingModule),
|
|
typeof(AbpAspNetCoreHttpOverridesModule),
|
|
typeof(AbpSwashbuckleModule),
|
|
typeof(AbpAutofacModule)
|
|
)]
|
|
public partial class PlatformServiceModule : AbpModule
|
|
{
|
|
public override void PreConfigureServices(ServiceConfigurationContext context)
|
|
{
|
|
var configuration = context.Services.GetConfiguration();
|
|
|
|
PreConfigureWrapper();
|
|
PreForwardedHeaders();
|
|
PreConfigureFeature();
|
|
PreConfigureApp(configuration);
|
|
PreConfigureCAP(configuration);
|
|
}
|
|
|
|
public override void ConfigureServices(ServiceConfigurationContext context)
|
|
{
|
|
var hostingEnvironment = context.Services.GetHostingEnvironment();
|
|
var configuration = context.Services.GetConfiguration();
|
|
|
|
ConfigureWrapper();
|
|
ConfigureLocalization();
|
|
ConfigureKestrelServer();
|
|
ConfigureExceptionHandling();
|
|
ConfigureVirtualFileSystem();
|
|
ConfigureFeatureManagement();
|
|
ConfigurePermissionManagement();
|
|
ConfigureTiming(configuration);
|
|
ConfigureCaching(configuration);
|
|
ConfigureIdentity(configuration);
|
|
ConfigureAuditing(configuration);
|
|
ConfigureMultiTenancy(configuration);
|
|
ConfigureJsonSerializer(configuration);
|
|
ConfigureMvc(context.Services, configuration);
|
|
ConfigureCors(context.Services, configuration);
|
|
ConfigureSwagger(context.Services, configuration);
|
|
ConfigureDistributedLocking(context.Services, configuration);
|
|
ConfigureSecurity(context.Services, configuration, hostingEnvironment.IsDevelopment());
|
|
|
|
ConfigurePlatformModule(context.Services);
|
|
}
|
|
|
|
public override void OnApplicationInitialization(ApplicationInitializationContext context)
|
|
{
|
|
AsyncHelper.RunSync(() => OnApplicationInitializationAsync(context));
|
|
}
|
|
|
|
public async override Task OnApplicationInitializationAsync(ApplicationInitializationContext context)
|
|
{
|
|
var options = context.ServiceProvider.GetRequiredService<IOptions<AbpOssManagementOptions>>().Value;
|
|
if (options.IsCleanupEnabled)
|
|
{
|
|
await context.ServiceProvider
|
|
.GetRequiredService<IBackgroundWorkerManager>()
|
|
.AddAsync(context.ServiceProvider.GetRequiredService<OssObjectTempCleanupBackgroundWorker>());
|
|
}
|
|
}
|
|
}
|
|
|