FoodLabelingThApplicationModule.cs 1.46 KB
using FoodLabeling.Application;
using FoodLabeling.Th.Application.Contracts;
using FoodLabeling.Th.Application.Contracts.Options;
using FoodLabeling.Th.Application.Filters;
using FoodLabeling.Th.Domain;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Yi.Framework.Ddd.Application;

namespace FoodLabeling.Th.Application;

/// <summary>
/// Food Labeling 模块 - 应用层(泰额版多租户壳层)
/// </summary>
[DependsOn(
    typeof(FoodLabelingThApplicationContractsModule),
    typeof(FoodLabelingThDomainModule),
    typeof(FoodLabelingApplicationModule),
    typeof(YiFrameworkDddApplicationModule)
)]
public class FoodLabelingThApplicationModule : AbpModule
{
    public override void ConfigureServices(ServiceConfigurationContext context)
    {
        var configuration = context.Services.GetConfiguration();

        Configure<FoodLabelingThTenantDatabaseOptions>(
            configuration.GetSection(FoodLabelingThTenantDatabaseOptions.SectionName));

        Configure<FoodLabelingThMultiTenancyOptions>(
            configuration.GetSection(FoodLabelingThMultiTenancyOptions.SectionName));

        Configure<FoodLabelingThTenantSelectCryptoOptions>(
            configuration.GetSection(FoodLabelingThTenantSelectCryptoOptions.SectionName));

        Configure<MvcOptions>(options =>
        {
            options.Filters.AddService<FoodLabelingBusinessTenantActionFilter>();
        });
    }
}