feat(cli): add ms microservice template support
1. 新增`ms`微服务模板,包含共享项目、微服务、网关、应用等完整架构 2. 为`hua new`命令添加`ms`模板选项并更新文档 3. 将模板文件嵌入CLI项目输出目录 4. 实现微服务模板的项目构建逻辑,自动安装并使用dotnet自定义模板创建项目
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Company.Project.Shared;
|
||||
using Volo.Abp;
|
||||
using Volo.Abp.Account;
|
||||
using Volo.Abp.Account.Web;
|
||||
using Volo.Abp.AspNetCore.Mvc.UI.BasicTheme;
|
||||
using Volo.Abp.Autofac;
|
||||
using Volo.Abp.EntityFrameworkCore;
|
||||
using Volo.Abp.EntityFrameworkCore.SqlServer;
|
||||
using Volo.Abp.Identity;
|
||||
using Volo.Abp.Identity.EntityFrameworkCore;
|
||||
using Volo.Abp.IdentityServer.EntityFrameworkCore;
|
||||
using Volo.Abp.Modularity;
|
||||
using Volo.Abp.MultiTenancy;
|
||||
using Volo.Abp.TenantManagement.EntityFrameworkCore;
|
||||
|
||||
namespace Company.Project.AuthServer;
|
||||
|
||||
[DependsOn(
|
||||
typeof(AbpAutofacModule),
|
||||
typeof(AbpAspNetCoreMvcUiBasicThemeModule),
|
||||
typeof(AbpIdentityEntityFrameworkCoreModule),
|
||||
typeof(AbpIdentityApplicationModule),
|
||||
typeof(AbpIdentityServerEntityFrameworkCoreModule),
|
||||
typeof(AbpAccountWebIdentityServerModule),
|
||||
typeof(AbpTenantManagementEntityFrameworkCoreModule)
|
||||
)]
|
||||
public class AuthServerHostModule : AbpModule
|
||||
{
|
||||
public override void ConfigureServices(ServiceConfigurationContext context)
|
||||
{
|
||||
Configure<AbpMultiTenancyOptions>(options =>
|
||||
{
|
||||
options.IsEnabled = ProjectConsts.IsMultiTenancyEnabled;
|
||||
});
|
||||
|
||||
Configure<AbpDbContextOptions>(options => options.UseSqlServer());
|
||||
}
|
||||
|
||||
public override void OnApplicationInitialization(ApplicationInitializationContext context)
|
||||
{
|
||||
var app = context.GetApplicationBuilder();
|
||||
app.UseStaticFiles();
|
||||
app.UseRouting();
|
||||
app.UseIdentityServer();
|
||||
app.UseConfiguredEndpoints();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user