From 979250b91266f9423928e08ef3fb907db9cfb47a Mon Sep 17 00:00:00 2001 From: Antinew <2357729423@qq.com> Date: Sat, 12 Jul 2025 00:51:00 +0800 Subject: [PATCH] fix --- src/InterfaceForward.Api/InterfaceForward.Api.csproj | 2 +- src/InterfaceForward.Api/appsettings.json | 3 ++- .../InterfaceForward.Application.csproj | 6 +++--- .../Services/ServiceProvider/ServiceProviderService.cs | 2 +- .../InterfaceForward.Domain.Shared.csproj | 2 +- .../InterfaceForwardDomainSharedModule.cs | 4 +++- src/InterfaceForward.Repositories/BasicRepository.cs | 4 ++-- .../Interface/ValueObjects/GetMapListInputVO.cs | 2 +- .../SystemInterfacePaginatedInputObjectValue.cs | 2 +- .../InterfaceForward.Repositories.csproj | 2 +- .../InterfaceForwardDbContext.cs | 7 +++++++ .../ServiceProvider/Services/IServiceProviderRepository.cs | 2 +- .../ServiceProvider/Services/ServiceProviderRepository.cs | 2 +- 13 files changed, 25 insertions(+), 15 deletions(-) diff --git a/src/InterfaceForward.Api/InterfaceForward.Api.csproj b/src/InterfaceForward.Api/InterfaceForward.Api.csproj index 9f5a987..a6395d1 100644 --- a/src/InterfaceForward.Api/InterfaceForward.Api.csproj +++ b/src/InterfaceForward.Api/InterfaceForward.Api.csproj @@ -10,7 +10,7 @@ - + diff --git a/src/InterfaceForward.Api/appsettings.json b/src/InterfaceForward.Api/appsettings.json index 5bdec34..d24d7f6 100644 --- a/src/InterfaceForward.Api/appsettings.json +++ b/src/InterfaceForward.Api/appsettings.json @@ -48,7 +48,8 @@ "HostName": "129.204.22.146", "Port": 5672, "UserName": "rabbit", - "Password": "itd!@#123" + "Password": "itd!@#123", + "DispatchConsumersAsync": true } } }, diff --git a/src/InterfaceForward.Application/InterfaceForward.Application.csproj b/src/InterfaceForward.Application/InterfaceForward.Application.csproj index be834f3..5993c35 100644 --- a/src/InterfaceForward.Application/InterfaceForward.Application.csproj +++ b/src/InterfaceForward.Application/InterfaceForward.Application.csproj @@ -17,9 +17,9 @@ - - - + + + diff --git a/src/InterfaceForward.Application/Services/ServiceProvider/ServiceProviderService.cs b/src/InterfaceForward.Application/Services/ServiceProvider/ServiceProviderService.cs index 1b6b524..77b0b3f 100644 --- a/src/InterfaceForward.Application/Services/ServiceProvider/ServiceProviderService.cs +++ b/src/InterfaceForward.Application/Services/ServiceProvider/ServiceProviderService.cs @@ -51,7 +51,7 @@ public class ServiceProviderService : ApplicationService /// [HttpGet("ServiceProvider/GetServiceProviderInterfaceCascadedList")] public async Task> - GetServiceProviderInterfaceCascadedListAsync([Required] int interfaceId, string serviceProviderName) + GetServiceProviderInterfaceCascadedListAsync([Required] int interfaceId, string? serviceProviderName) { return await _serviceProviderRepository.GetServiceProviderInterfaceCascadedListAsync(interfaceId, serviceProviderName); diff --git a/src/InterfaceForward.Domain.Shared/InterfaceForward.Domain.Shared.csproj b/src/InterfaceForward.Domain.Shared/InterfaceForward.Domain.Shared.csproj index d505fe0..abd370a 100644 --- a/src/InterfaceForward.Domain.Shared/InterfaceForward.Domain.Shared.csproj +++ b/src/InterfaceForward.Domain.Shared/InterfaceForward.Domain.Shared.csproj @@ -11,6 +11,6 @@ - + diff --git a/src/InterfaceForward.Domain.Shared/InterfaceForwardDomainSharedModule.cs b/src/InterfaceForward.Domain.Shared/InterfaceForwardDomainSharedModule.cs index f4e18c5..17a6217 100644 --- a/src/InterfaceForward.Domain.Shared/InterfaceForwardDomainSharedModule.cs +++ b/src/InterfaceForward.Domain.Shared/InterfaceForwardDomainSharedModule.cs @@ -1,4 +1,5 @@ -using Fake.Modularity; +using Fake.DomainDrivenDesign; +using Fake.Modularity; using InterfaceForward.Domain.Shared.Helpers; using InterfaceForward.Domain.Shared.Options; using Microsoft.Extensions.Configuration; @@ -6,6 +7,7 @@ using Microsoft.Extensions.DependencyInjection; namespace InterfaceForward.Domain.Shared { + [DependsOn(typeof(FakeDomainDrivenDesignModule))] public class InterfaceForwardDomainSharedModule : FakeModule { public override void ConfigureServices(ServiceConfigurationContext context) diff --git a/src/InterfaceForward.Repositories/BasicRepository.cs b/src/InterfaceForward.Repositories/BasicRepository.cs index a117f95..ef2a684 100644 --- a/src/InterfaceForward.Repositories/BasicRepository.cs +++ b/src/InterfaceForward.Repositories/BasicRepository.cs @@ -10,7 +10,7 @@ namespace InterfaceForward.Repositories; /// public class BasicRepository : SqlSugarRepository, IBasicRepositorywhere T : class, IAggregateRoot, new() { - protected ISqlSugarClient Context => GetDbContextAsync().Result.SqlSugarClient; + protected ISqlSugarClient Context => GetDbContextAsync().Result; public ISugarQueryable AsQueryable() { @@ -37,7 +37,7 @@ public class BasicRepository : SqlSugarRepository> resultExpression) { var ctx = await GetDbContextAsync(); - return await ctx.SqlSugarClient.Queryable().Where(whereExpression).Select(resultExpression).ToListAsync(); + return await ctx.Queryable().Where(whereExpression).Select(resultExpression).ToListAsync(); } public async Task CountAsync(Expression> exp) diff --git a/src/InterfaceForward.Repositories/Interface/ValueObjects/GetMapListInputVO.cs b/src/InterfaceForward.Repositories/Interface/ValueObjects/GetMapListInputVO.cs index 203a38f..7e5719c 100644 --- a/src/InterfaceForward.Repositories/Interface/ValueObjects/GetMapListInputVO.cs +++ b/src/InterfaceForward.Repositories/Interface/ValueObjects/GetMapListInputVO.cs @@ -8,5 +8,5 @@ public class GetMapListInputVO : PagedQueryInput [Required] public int InterfaceId { get; set; } - public string NameOrCode { get; set; } + public string? NameOrCode { get; set; } } \ No newline at end of file diff --git a/src/InterfaceForward.Repositories/Interface/ValueObjects/SystemInterfacePaginatedInputObjectValue.cs b/src/InterfaceForward.Repositories/Interface/ValueObjects/SystemInterfacePaginatedInputObjectValue.cs index dc1e393..ec47100 100644 --- a/src/InterfaceForward.Repositories/Interface/ValueObjects/SystemInterfacePaginatedInputObjectValue.cs +++ b/src/InterfaceForward.Repositories/Interface/ValueObjects/SystemInterfacePaginatedInputObjectValue.cs @@ -15,6 +15,6 @@ namespace InterfaceForward.Repositories.Interface.ValueObjects /// /// 接口名 /// - public string NameOrCode { get; set; } + public string? NameOrCode { get; set; } } } \ No newline at end of file diff --git a/src/InterfaceForward.Repositories/InterfaceForward.Repositories.csproj b/src/InterfaceForward.Repositories/InterfaceForward.Repositories.csproj index f04b915..26f2923 100644 --- a/src/InterfaceForward.Repositories/InterfaceForward.Repositories.csproj +++ b/src/InterfaceForward.Repositories/InterfaceForward.Repositories.csproj @@ -7,7 +7,7 @@ - + diff --git a/src/InterfaceForward.Repositories/InterfaceForwardDbContext.cs b/src/InterfaceForward.Repositories/InterfaceForwardDbContext.cs index a329014..74dfc66 100644 --- a/src/InterfaceForward.Repositories/InterfaceForwardDbContext.cs +++ b/src/InterfaceForward.Repositories/InterfaceForwardDbContext.cs @@ -24,4 +24,11 @@ public class InterfaceForwardDbContext:SugarDbContext base.ConfigureEntityService(property, column); } + + protected override void ConfigureGlobalFilters() + { + //需自定义扩展 + SqlSugarClient.QueryFilter.AddTableFilter(u => + DataFilter.IsEnabled() == false || !u.IsDeleted); + } } \ No newline at end of file diff --git a/src/InterfaceForward.Repositories/ServiceProvider/Services/IServiceProviderRepository.cs b/src/InterfaceForward.Repositories/ServiceProvider/Services/IServiceProviderRepository.cs index 072b2aa..9b21902 100644 --- a/src/InterfaceForward.Repositories/ServiceProvider/Services/IServiceProviderRepository.cs +++ b/src/InterfaceForward.Repositories/ServiceProvider/Services/IServiceProviderRepository.cs @@ -22,7 +22,7 @@ namespace InterfaceForward.Repositories.ServiceProvider.Services /// /// Task> GetServiceProviderInterfaceCascadedListAsync( - int interfaceId, string serviceProviderName); + int interfaceId, string? serviceProviderName); /// /// 更新服务商 diff --git a/src/InterfaceForward.Repositories/ServiceProvider/Services/ServiceProviderRepository.cs b/src/InterfaceForward.Repositories/ServiceProvider/Services/ServiceProviderRepository.cs index 76e502f..cc7a58d 100644 --- a/src/InterfaceForward.Repositories/ServiceProvider/Services/ServiceProviderRepository.cs +++ b/src/InterfaceForward.Repositories/ServiceProvider/Services/ServiceProviderRepository.cs @@ -46,7 +46,7 @@ public class ServiceProviderRepository : BasicRepository, /// public async Task> - GetServiceProviderInterfaceCascadedListAsync(int interfaceId, string serviceProviderName) + GetServiceProviderInterfaceCascadedListAsync(int interfaceId, string? serviceProviderName) { var mappedIds = await Context.Queryable() .LeftJoin((x, y) => x.DownStreamId == y.Id)