Files
Hua.Cli/templates/ms/applications/Company.Project.BackendAdminApp.Host/BackendAdminAppHostModule.cs
T
ShaoHua 2a6f5f81b7 feat(cli): add ms microservice template support
1. 新增`ms`微服务模板,包含共享项目、微服务、网关、应用等完整架构
2. 为`hua new`命令添加`ms`模板选项并更新文档
3. 将模板文件嵌入CLI项目输出目录
4. 实现微服务模板的项目构建逻辑,自动安装并使用dotnet自定义模板创建项目
2026-07-15 11:30:43 +08:00

44 lines
1.3 KiB
C#

using Company.Project.Shared;
using ProductManagement;
using ProductManagement.Web;
using Volo.Abp;
using Volo.Abp.AspNetCore.Mvc.Client;
using Volo.Abp.AspNetCore.Mvc.UI.BasicTheme;
using Volo.Abp.Autofac;
using Volo.Abp.Http.Client.IdentityModel.Web;
using Volo.Abp.Identity.Web;
using Volo.Abp.Modularity;
using Volo.Abp.MultiTenancy;
using Volo.Abp.TenantManagement.Web;
namespace Company.Project.BackendAdminApp;
[DependsOn(
typeof(AbpAutofacModule),
typeof(AbpAspNetCoreMvcClientModule),
typeof(AbpAspNetCoreMvcUiBasicThemeModule),
typeof(AbpHttpClientIdentityModelWebModule),
typeof(AbpIdentityWebModule),
typeof(AbpTenantManagementWebModule),
typeof(ProductManagementHttpApiClientModule),
typeof(ProductManagementWebModule)
)]
public class BackendAdminAppHostModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpMultiTenancyOptions>(options =>
{
options.IsEnabled = ProjectConsts.IsMultiTenancyEnabled;
});
}
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
var app = context.GetApplicationBuilder();
app.UseStaticFiles();
app.UseRouting();
app.UseConfiguredEndpoints();
}
}