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 1/3] 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) From 3172f1756858fdcf94cdd65006055ecca77d3fd4 Mon Sep 17 00:00:00 2001 From: Antinew <2357729423@qq.com> Date: Sun, 13 Jul 2025 19:12:30 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix=EF=BC=9Anull=20required?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/InterfaceMap/InterfaceMapPublishService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/InterfaceForward.Application/Services/InterfaceMap/InterfaceMapPublishService.cs b/src/InterfaceForward.Application/Services/InterfaceMap/InterfaceMapPublishService.cs index 1282ac0..a8777c4 100644 --- a/src/InterfaceForward.Application/Services/InterfaceMap/InterfaceMapPublishService.cs +++ b/src/InterfaceForward.Application/Services/InterfaceMap/InterfaceMapPublishService.cs @@ -57,7 +57,7 @@ public class InterfaceMapPublishService( /// [HttpGet("InterfaceMap/GetPublishCompare")] public async Task GetPublishCompareAsync([Required] string interfaceCode, - [Required] int serviceProviderId, string version) + [Required] int serviceProviderId, string? version) { var systemInterface = await interfaceForwardQuery.GetInterfaceByCodesAsync(interfaceCode); if (systemInterface == null) throw new BusinessException(message: "系统接口不存在"); From 5416c13e2c1362c8242bc1a09f44a9afe82344fe Mon Sep 17 00:00:00 2001 From: Antinew <2357729423@qq.com> Date: Mon, 14 Jul 2025 22:48:01 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fix=EF=BC=9Anull=20required=EF=BC=88at=20sa?= =?UTF-8?q?ve=20parameter=20maps=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dtos/Interface/SaveParameterMapsInput.cs | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/InterfaceForward.Application.Contracts/Dtos/Interface/SaveParameterMapsInput.cs b/src/InterfaceForward.Application.Contracts/Dtos/Interface/SaveParameterMapsInput.cs index 9df9a97..499bef3 100644 --- a/src/InterfaceForward.Application.Contracts/Dtos/Interface/SaveParameterMapsInput.cs +++ b/src/InterfaceForward.Application.Contracts/Dtos/Interface/SaveParameterMapsInput.cs @@ -2,19 +2,15 @@ public class SaveParameterMapsInput { - public SaveParameterMapsInput() - { - InParaMapList = new(); - } /// /// 入参映射列表 /// - public List InParaMapList { get; set; } + public List InParaMapList { get; set; } = new(); /// /// 出参映射明细 /// - public List MapDetails { get; set; } + public List MapDetails { get; set; } = new(); } public class MapItem @@ -32,12 +28,12 @@ public class MapItem /// /// 前置脚本 /// - public string PrefixScript { get; set; } + public string? PrefixScript { get; set; } /// /// 后置脚本 /// - public string PostfixScript { get; set; } + public string? PostfixScript { get; set; } /// /// 自由映射(支持不对等映射) @@ -47,7 +43,7 @@ public class MapItem /// /// 入参映射明细 /// - public List MapDetails { get; set; } + public List MapDetails { get; set; } = new(); } public class InterfaceMapDetail @@ -60,17 +56,17 @@ public class InterfaceMapDetail /// /// 【固定参数专用】固定参数值 /// - public string FixedValue { get; set; } + public string? FixedValue { get; set; } /// /// 【固定参数专用】服务商参数别名 xxx.xxx /// - public string Alias { get; set; } + public string? Alias { get; set; } /// /// 【固定参数专用】服务商参数描述 /// - public string Description { get; set; } + public string? Description { get; set; } /// /// 是否必填