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
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<RootNamespace>Company.Project.IdentityService</RootNamespace>
</PropertyGroup>
<ItemGroup>
@@ -0,0 +1,12 @@
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc;
namespace Company.Project.IdentityService.Controllers;
public class HomeController : AbpController
{
public ActionResult Index()
{
return Redirect("/swagger");
}
}
@@ -0,0 +1,20 @@
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
WORKDIR /app
EXPOSE 80
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
COPY ["microservices/Company.Project.IdentityService.Host/Company.Project.IdentityService.Host.csproj", "microservices/Company.Project.IdentityService.Host/"]
COPY ["shared/Company.Project.Shared/Company.Project.Shared.csproj", "shared/Company.Project.Shared/"]
RUN dotnet restore "microservices/Company.Project.IdentityService.Host/Company.Project.IdentityService.Host.csproj" -nowarn:msb3202,msb3277,nu1503
COPY . .
WORKDIR "/src/microservices/Company.Project.IdentityService.Host"
RUN dotnet build "Company.Project.IdentityService.Host.csproj" --no-restore -nowarn:msb3202,msb3277,nu1503 -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "Company.Project.IdentityService.Host.csproj" --no-restore -nowarn:msb3202,msb3277,nu1503 -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Company.Project.IdentityService.Host.dll"]
@@ -0,0 +1,20 @@
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
WORKDIR /app
EXPOSE 80
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
COPY ["microservices/Company.Project.IdentityService.Host/Company.Project.IdentityService.Host.csproj", "microservices/Company.Project.IdentityService.Host/"]
COPY ["shared/Company.Project.Shared/Company.Project.Shared.csproj", "shared/Company.Project.Shared/"]
RUN dotnet restore "microservices/Company.Project.IdentityService.Host/Company.Project.IdentityService.Host.csproj" -nowarn:msb3202,msb3277,nu1503
COPY . .
WORKDIR "/src/microservices/Company.Project.IdentityService.Host"
RUN dotnet build "Company.Project.IdentityService.Host.csproj" --no-restore -nowarn:msb3202,msb3277,nu1503 -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "Company.Project.IdentityService.Host.csproj" --no-restore -nowarn:msb3202,msb3277,nu1503 -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Company.Project.IdentityService.Host.dll"]
@@ -0,0 +1,27 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "https://localhost:44368",
"sslPort": 0
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"Company.Project.IdentityService.Host": {
"commandName": "Project",
"launchBrowser": true,
"applicationUrl": "https://localhost:44368",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
@@ -0,0 +1,37 @@
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Entities.Events.Distributed;
using Volo.Abp.EventBus.Distributed;
using Volo.Abp.MultiTenancy;
using Volo.Abp.TenantManagement;
namespace Company.Project.IdentityService.Tenants;
public class TenantCreatedDistributedEventHandler : IDistributedEventHandler<EntityCreatedEto<TenantEto>>, ITransientDependency
{
public ILogger<TenantCreatedDistributedEventHandler> Logger { get; set; }
private readonly IDataSeeder _dataSeeder;
private readonly ICurrentTenant _currentTenant;
public TenantCreatedDistributedEventHandler(
IDataSeeder dataSeeder,
ICurrentTenant currentTenant)
{
_dataSeeder = dataSeeder;
_currentTenant = currentTenant;
Logger = NullLogger<TenantCreatedDistributedEventHandler>.Instance;
}
public async Task HandleEventAsync(EntityCreatedEto<TenantEto> eventData)
{
Logger.LogInformation($"Handled distributed event for a new tenant creation. TenantId: {eventData.Entity.Id}");
using (_currentTenant.Change(eventData.Entity.Id, eventData.Entity.Name))
{
await _dataSeeder.SeedAsync(tenantId: eventData.Entity.Id);
}
}
}
@@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Debug",
"System": "Information",
"Microsoft": "Information"
}
}
}