upgrade:框架迁移到ideship
Some checks failed
CI/CD Pipeline / deploy (push) Has been cancelled

This commit is contained in:
xiaolipro 2026-09-05 16:13:08 +08:00
parent 9156923294
commit ef4280ef0f
30 changed files with 53 additions and 41 deletions

View File

@ -1,7 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="ideship" value="http://baget.ideship.com/v3/index.json" />
<clear />
<add key="ideship" value="https://baget.ideship.com/v3/index.json" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
</configuration>

View File

@ -1,17 +1,27 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0.303 AS base
ARG BUILD_CONFIGURATION=Release
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
COPY . /src
ARG NUGET_IDESHIP=https://baget.ideship.com/v3/index.json
COPY ["NuGet.Config", "Directory.Build.props", "common.props", "./"]
RUN sed -i \
-e "s|https://baget.ideship.com/v3/index.json|${NUGET_IDESHIP}|g" \
-e "s|http://baget.ideship.com/v3/index.json|${NUGET_IDESHIP}|g" \
NuGet.Config \
&& cat NuGet.Config
COPY ["src/TrackCenter.Domain/TrackCenter.Domain.csproj", "src/TrackCenter.Domain/"]
COPY ["src/TrackCenter.Repository/TrackCenter.Repository.csproj", "src/TrackCenter.Repository/"]
COPY ["src/TrackCenter.Application/TrackCenter.Application.csproj", "src/TrackCenter.Application/"]
COPY ["src/TrackCenter.Api/TrackCenter.Api.csproj", "src/TrackCenter.Api/"]
RUN dotnet restore "src/TrackCenter.Api/TrackCenter.Api.csproj"
WORKDIR "/src/src/TrackCenter.Api"
RUN dotnet build "TrackCenter.Api.csproj" -c $BUILD_CONFIGURATION -o /app/build
FROM base AS publish
COPY . .
WORKDIR /src/src/TrackCenter.Api
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "TrackCenter.Api.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
RUN dotnet publish "TrackCenter.Api.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false --no-restore
# 使用运行时镜像
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
WORKDIR /app
COPY --from=publish /app/publish .
COPY --from=build /app/publish .
ENTRYPOINT ["dotnet", "TrackCenter.Api.dll"]

View File

@ -5,12 +5,13 @@
<PropertyGroup>
<TargetFramework>net8</TargetFramework>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<EnableSdkContainerSupport>true</EnableSdkContainerSupport>
<ContainerBaseImage>mcr.microsoft.com/dotnet/aspnet:8.0</ContainerBaseImage>
<ContainerWorkingDirectory>/app</ContainerWorkingDirectory>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FluentValidation.AspNetCore" Version="11.2.2"/>
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.2"/>
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.17.0"/>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0"/>
</ItemGroup>

View File

@ -1,6 +1,9 @@
using Fake.AspNetCore;
using Fake.AspNetCore.Auditing;
using Fake.AspNetCore.Mvc;
using Fake.AspNetCore.Authentication;
using Fake.AspNetCore.ExceptionHandling;
using Fake.AspNetCore;
using Fake.AspNetCore.Swagger;
using Fake.Autofac;
using Fake.FeiShu;
using Fake.Modularity;
@ -72,7 +75,8 @@ public class TrackCenterApiModule : FakeModule
});
services.AddFakeSwaggerGen(addSecurity:true)
.AddFakeAspNetCoreAuditing();
.AddFakeAspNetCoreAuditing()
.AddFeiShuNotification();
services.AddFluentValidationAutoValidation().AddFluentValidationClientsideAdapters();

View File

@ -1,5 +1,4 @@
using AutoMapper;
using Fake.Application.Dtos;
using TrackCenter.Application.Dtos.ProvideServices;
using TrackCenter.Application.Dtos.TrackOrder;
using TrackCenter.Domain.Aggregates.OrderAggregate;

View File

@ -1,5 +1,5 @@
using AutoMapper;
using Fake.Application.Dtos;
using Fake.Domain.Dtos;
using TrackCenter.Application.Dtos.TrackContents;
using TrackCenter.Domain.Aggregates.TrackContentAggregate;
using TrackCenter.Domain.Aggregates.TrackDetailsAggregate;

View File

@ -1,5 +1,4 @@
using AutoMapper;
using Fake.Application.Dtos;
using TrackCenter.Application.Dtos.TrackFlags;
using TrackCenter.Domain.Aggregates.TrackFlagAggregate;
using TrackCenter.Domain.Dtos.TrackFlags;

View File

@ -1,5 +1,4 @@
using AutoMapper;
using Fake.Application.Dtos;
using TrackCenter.Application.Dtos.TrackStatus;
using TrackCenter.Domain.Aggregates.TrackStatusAggregate;
using TrackCenter.Domain.Dtos.TrackStatus;

View File

@ -1,5 +1,6 @@
global using Fake.Application;
global using Fake.DependencyInjection;
global using Fake.Domain.Dtos;
global using TrackCenter.Domain.Consts;
global using Microsoft.AspNetCore.Mvc;
global using Microsoft.Extensions.DependencyInjection;

View File

@ -8,7 +8,6 @@ using TrackCenter.Domain.Aggregates.TrackStatusAggregate;
using TrackCenter.Domain.Dtos.Order;
using TrackCenter.Domain.Dtos.TrackContents;
using TrackCenter.Domain.Dtos.TrackPull;
using TrackCenter.Domain.VEntities;
using TrackCenter.Repository;
namespace TrackCenter.Application.Queries;

View File

@ -1,5 +1,5 @@
using System.Linq.Expressions;
using Fake.Application.Dtos;
using Fake.Domain.Dtos;
using TrackCenter.Application.Dtos.ProvideServices;
using TrackCenter.Application.Dtos.TrackContents;
using TrackCenter.Application.Helpers;

View File

@ -1,4 +1,4 @@
using Fake.Application.Dtos;
using Fake.Domain.Dtos;
using TrackCenter.Application.Dtos.TrackFlags;
using TrackCenter.Domain.Aggregates.TrackContentAggregate;
using TrackCenter.Domain.Aggregates.TrackFlagAggregate;

View File

@ -1,5 +1,5 @@
using System.Linq.Expressions;
using Fake.Application.Dtos;
using Fake.Domain.Dtos;
using TrackCenter.Application.Dtos.ProvideServices;
using TrackCenter.Application.Dtos.TrackOrder;
using TrackCenter.Application.Helpers;

View File

@ -1,6 +1,6 @@
using System.ComponentModel;
using System.Linq.Expressions;
using Fake.Application.Dtos;
using Fake.Domain.Dtos;
using TrackCenter.Application.Dtos.TrackPull;
using TrackCenter.Domain.Aggregates.TrackPullAggregate;
using TrackCenter.Domain.Dtos.TrackPull;

View File

@ -1,5 +1,5 @@
using System.Linq.Expressions;
using Fake.Application.Dtos;
using Fake.Domain.Dtos;
using InterfaceForward.Domain.Shared.Helpers;
using TrackCenter.Application.Dtos.TrackPush;
using TrackCenter.Application.Helpers;

View File

@ -1,4 +1,4 @@
using Fake.Application.Dtos;
using Fake.Domain.Dtos;
using TrackCenter.Application.Dtos.TrackStatus;
using TrackCenter.Domain.Aggregates.TrackContentAggregate;
using TrackCenter.Domain.Aggregates.TrackStatusAggregate;

View File

@ -1,4 +1,4 @@
using Fake.Application.Dtos;
using Fake.Domain.Dtos;
using InterfaceForward.Domain.Shared.Helpers;
using TrackCenter.Application.Dtos.Warning;
using TrackCenter.Application.Dtos.Warning.Complete;

View File

@ -1,5 +1,5 @@
using DotNetCore.CAP;
using Fake.Application.Dtos;
using Fake.Domain.Dtos;
using InterfaceForward.Domain.Shared.Helpers;
using TrackCenter.Application.Dtos.Warning;
using TrackCenter.Application.Dtos.Warning.Return;

View File

@ -1,4 +1,4 @@
using Fake.Application.Dtos;
using Fake.Domain.Dtos;
using InterfaceForward.Domain.Shared.Helpers;
using TrackCenter.Application.Dtos.Warning;
using TrackCenter.Application.Dtos.Warning.Transport;

View File

@ -1,4 +1,4 @@
using Fake.Application.Dtos;
using Fake.Domain.Dtos;
using TrackCenter.Domain.Dtos.Order;
namespace TrackCenter.Domain.Aggregates.OrderAggregate;

View File

@ -1,4 +1,4 @@
using Fake.Application.Dtos;
using Fake.Domain.Dtos;
using TrackCenter.Domain.Dtos.TrackContents;
namespace TrackCenter.Domain.Aggregates.TrackContentAggregate;

View File

@ -1,4 +1,4 @@
using Fake.Application.Dtos;
using Fake.Domain.Dtos;
using TrackCenter.Domain.Dtos.TrackFlags;
namespace TrackCenter.Domain.Aggregates.TrackFlagAggregate;

View File

@ -1,4 +1,4 @@
using Fake.Application.Dtos;
using Fake.Domain.Dtos;
using TrackCenter.Domain.Dtos.Common;
using TrackCenter.Domain.Dtos.TrackPull;

View File

@ -1,4 +1,4 @@
using Fake.Application.Dtos;
using Fake.Domain.Dtos;
using TrackCenter.Domain.Dtos.TrackPush;
namespace TrackCenter.Domain.Aggregates.TrackPushAggregate;

View File

@ -1,4 +1,4 @@
using Fake.Application.Dtos;
using Fake.Domain.Dtos;
using TrackCenter.Domain.Dtos.TrackStatus;
namespace TrackCenter.Domain.Aggregates.TrackStatusAggregate;

View File

@ -1,4 +1,4 @@
using Fake.Application.Dtos;
using Fake.Domain.Dtos;
using TrackCenter.Domain.Aggregates.WarningAggregate.Complete;
using TrackCenter.Domain.Aggregates.WarningAggregate.Return;
using TrackCenter.Domain.Aggregates.WarningAggregate.Transport;

View File

@ -13,7 +13,7 @@
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Fake.Serilog" Version="$(FakePackageVersion)" />
<PackageReference Include="Fake.DomainDrivenDesign" Version="$(FakePackageVersion)" />
<PackageReference Include="Fake.Ddd.Domain" Version="$(FakePackageVersion)" />
</ItemGroup>
</Project>

View File

@ -6,7 +6,7 @@ using TrackCenter.Domain.Extensions;
namespace TrackCenter.Domain;
[DependsOn(typeof(FakeDomainDrivenDesignModule))]
[DependsOn(typeof(FakeDddDomainModule))]
public class TrackCenterDomainModule : FakeModule
{
public override void ConfigureServices(ServiceConfigurationContext context)

View File

@ -1,2 +1,2 @@
global using SqlSugar;
global using Fake.Application.Dtos;
global using Fake.Domain.Dtos;

View File

@ -1,5 +1,5 @@
using System.Linq.Expressions;
using Fake.Application;
using Fake;
using Fake.Domain.Entities;
using Fake.Domain.Entities.Auditing;
using Fake.DomainDrivenDesign.Repositories.SqlSugarCore;
@ -79,8 +79,7 @@ public class BasicRepository<T> : SqlSugarRepository<TrackCenterDbContext, T>, I
public async Task<bool> SoftDeleteAsync(Expression<Func<T, bool>>? where)
{
if (!typeof(T).IsAssignableTo<ISoftDelete>())
throw new BusinessException(
message: $"实体没有实现{nameof(ISoftDelete)}不能调用{nameof(SoftDeleteAsync)}");
throw new FakeException($"实体没有实现{nameof(ISoftDelete)}不能调用{nameof(SoftDeleteAsync)}");
// tips: required where
if (where == default) return false;