Files
tiku-backend.net/Tiku.Infrastructure/Modules/ContentModule.cs
xiong 3f5957d744
Some checks failed
ci / release-gate (push) Has been cancelled
feat(content): establish v2 learning delivery foundation
2026-08-06 09:52:18 +08:00

73 lines
4.1 KiB
C#

using Microsoft.Extensions.DependencyInjection;
using Tiku.Application.Assets;
using Tiku.Application.Catalog;
using Tiku.Application.Content;
using Tiku.Application.Jobs;
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.ContentV2;
using Tiku.Infrastructure.Content.Exports;
using Tiku.Infrastructure.Content.Imports;
using Tiku.Infrastructure.Assets.Security;
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<DirectContentServiceDependencies>();
services.AddScoped<IVocabularyManagementService, VocabularyManagementService>();
services.AddScoped<IHandbookManagementService, HandbookManagementService>();
services.AddScoped<IEducationCatalogManagementService, EducationCatalogManagementService>();
services.AddScoped<IScorelineManagementService, ScorelineManagementService>();
services.AddScoped<IVideoManagementService, VideoManagementService>();
services.AddScoped<IOperationContentManagementService, OperationContentManagementService>();
services.AddScoped<IContentImportService, ContentImportService>();
services.AddScoped<IPublicQuestionAccessPolicy, PublicQuestionAccessPolicy>();
services.AddScoped<IQuestionReferenceService, QuestionReferenceService>();
services.AddScoped<IContentReleaseCompiler, ContentReleaseCompiler>();
services.AddScoped<IContentCandidateReader, ContentCandidateReader>();
services.AddScoped<IPlatformContentPackageProjectionService, PlatformContentPackageProjectionService>();
services.AddScoped<IContentV2AuthoringService, ContentV2AuthoringService>();
services.AddScoped<IPlatformContentActorResolver, PlatformContentActorResolver>();
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<AssetManagementDependencies>();
services.AddScoped<IAssetCatalogManagementService, AssetCatalogManagementService>();
services.AddScoped<IAssetUploadManagementService, AssetUploadManagementService>();
services.AddScoped<IAssetLifecycleManagementService, AssetLifecycleManagementService>();
services.AddScoped<IAssetAuditQueryService, AssetAuditQueryService>();
services.AddScoped<IAssetImportJobQueryService, AssetImportJobQueryService>();
services.AddScoped<IAssetSecurityScanner, ClamAvAssetSecurityScanner>();
services.AddScoped<IBackgroundJobHandler, ContentImportJobHandler>();
services.AddScoped<IBackgroundJobHandler, ContentExportJobHandler>();
services.AddScoped<IBackgroundJobHandler, AssetSecurityScanJobHandler>();
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;
}
}