build: 升级目标框架到net10.0并完善模板配置

1. 将Hua.Cli.Tests、项目共享库、模块项目等所有项目的TargetFramework从net8.0/net9.0升级到net10.0
2. 完善dotnet-tools.json、模板配置文件,添加必要的构建和发布配置
3. 新增微服务、网关、应用程序的启动脚本和基础配置文件
4. 补充产品管理模块的领域、应用、Web层基础代码和多语言资源
This commit is contained in:
ShaoHua
2026-07-16 02:43:29 +08:00
parent 2a6f5f81b7
commit 734b2c91f9
264 changed files with 7132 additions and 451 deletions
@@ -0,0 +1,15 @@
using Volo.Abp;
using Volo.Abp.Modularity;
using Volo.Abp.Testing;
namespace ProductManagement
{
public abstract class ProductManagementTestBase<TStartupModule> : AbpIntegratedTest<TStartupModule>
where TStartupModule : IAbpModule
{
protected override void SetAbpApplicationCreationOptions(AbpApplicationCreationOptions options)
{
options.UseAutofac();
}
}
}
@@ -0,0 +1,43 @@
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp;
using Volo.Abp.Authorization;
using Volo.Abp.Autofac;
using Volo.Abp.Modularity;
using Volo.Abp.Uow;
namespace ProductManagement
{
[DependsOn(
typeof(AbpAutofacModule),
typeof(AbpTestBaseModule),
typeof(AbpAuthorizationModule),
typeof(ProductManagementDomainModule)
)]
public class ProductManagementTestBaseModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAlwaysAllowAuthorization();
Configure<AbpUnitOfWorkDefaultOptions>(options =>
{
options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled;
});
}
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
SeedTestData(context);
}
private static void SeedTestData(ApplicationInitializationContext context)
{
using (var scope = context.ServiceProvider.CreateScope())
{
scope.ServiceProvider
.GetRequiredService<ProductManagementTestDataBuilder>()
.Build();
}
}
}
}
@@ -0,0 +1,23 @@
using Volo.Abp.DependencyInjection;
namespace ProductManagement
{
public class ProductManagementTestData : ISingletonDependency
{
public string ProductCode1 { get; } = "ProductCode1";
public string ProductName1 { get; } = "ProductName1";
public float ProductPrice1 { get; } = 20;
public int ProductStockCount1 { get; } = 100;
public string ProductCode2 { get; } = "ProductCode2";
public string ProductName2 { get; } = "ProductName2";
public float ProductPrice2 { get; } = 30;
public int ProductStockCount2 { get; } = 110;
}
}
@@ -0,0 +1,33 @@
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Threading;
using Volo.Abp.Uow;
namespace ProductManagement
{
public class ProductManagementTestDataBuilder : ITransientDependency
{
private ProductManagementTestData _testData;
private readonly ProductManager _productManager;
public ProductManagementTestDataBuilder(
ProductManagementTestData testData,
ProductManager productManager)
{
_testData = testData;
_productManager = productManager;
}
public void Build()
{
AsyncHelper.RunSync(BuildAsync);
}
[UnitOfWork]
public virtual async Task BuildAsync()
{
await _productManager.CreateAsync(_testData.ProductCode1, _testData.ProductName1, _testData.ProductPrice1, _testData.ProductStockCount1);
await _productManager.CreateAsync(_testData.ProductCode2, _testData.ProductName2, _testData.ProductPrice2, _testData.ProductStockCount2);
}
}
}