refactor(architecture): enforce module boundaries
This commit is contained in:
51
Tiku.Infrastructure/Modules/ContentModule.cs
Normal file
51
Tiku.Infrastructure/Modules/ContentModule.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Tiku.Application.Assets;
|
||||
using Tiku.Application.Catalog;
|
||||
using Tiku.Application.Content;
|
||||
using Tiku.Application.Profile;
|
||||
using Tiku.Application.QuestionBanks;
|
||||
using Tiku.Application.Scoreline;
|
||||
using Tiku.Application.Storage;
|
||||
using Tiku.Application.StudyContent;
|
||||
using Tiku.Infrastructure.Assets;
|
||||
using Tiku.Infrastructure.Catalog;
|
||||
using Tiku.Infrastructure.Content;
|
||||
using Tiku.Infrastructure.Profile;
|
||||
using Tiku.Infrastructure.QuestionBanks;
|
||||
using Tiku.Infrastructure.Scoreline;
|
||||
using Tiku.Infrastructure.Storage;
|
||||
using Tiku.Infrastructure.StudyContent;
|
||||
|
||||
namespace Tiku.Infrastructure;
|
||||
|
||||
internal static class ContentModule
|
||||
{
|
||||
internal static IServiceCollection AddContentModule(this IServiceCollection services)
|
||||
{
|
||||
services.AddScoped<ICatalogQueryService, CatalogQueryService>();
|
||||
services.AddScoped<ITaxonomyService, TaxonomyService>();
|
||||
services.AddScoped<IContentNavigationQueryService, ContentNavigationQueryService>();
|
||||
services.AddScoped<IContentManagementService, ContentManagementService>();
|
||||
services.AddScoped<IDirectContentService, DirectContentService>();
|
||||
services.AddScoped<IQuestionBankQueryService, QuestionBankQueryService>();
|
||||
services.AddScoped<IPublicQuestionAccessPolicy, PublicQuestionAccessPolicy>();
|
||||
services.AddScoped<IQuestionReferenceService, QuestionReferenceService>();
|
||||
services.AddScoped<IProfileService, ProfileService>();
|
||||
services.AddScoped<ScorelineRecordQuery>();
|
||||
services.AddScoped<IScorelineQueryService, ScorelineQueryService>();
|
||||
services.AddScoped<IStudyContentQueryService, StudyContentQueryService>();
|
||||
services.AddScoped<IAssetQueryService, AssetQueryService>();
|
||||
services.AddScoped<IAssetAccessService, AssetAccessService>();
|
||||
services.AddScoped<IAssetManagementService, AssetManagementService>();
|
||||
services.AddScoped<IAssetSecurityScanner, ClamAvAssetSecurityScanner>();
|
||||
services.AddOptions<ClamAvOptions>();
|
||||
services.AddScoped<IVideoPlaybackService, VideoPlaybackService>();
|
||||
services.AddOptions<AliyunOssOptions>()
|
||||
.Validate(AliyunOssOptions.BeValid, "Aliyun OSS presign default expiration must be positive.");
|
||||
services.AddOptions<ObjectStorageOptions>()
|
||||
.Validate(ObjectStorageOptions.BeValid,
|
||||
"Storage options must include a default provider, default bucket and positive max upload bytes.");
|
||||
services.AddSingleton<IObjectStorageService, AliyunOssObjectStorageService>();
|
||||
return services;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user