From cac23b6569c7f732e75e984db90c4a7aca6e020e Mon Sep 17 00:00:00 2001 From: xiaolipro <2357729423@qq.com> Date: Thu, 17 Jul 2025 11:07:39 +0800 Subject: [PATCH 1/2] fix --- .../InterfaceForward.Api.csproj | 2 +- .../InterfaceForward.Application.csproj | 6 +++--- .../ServiceProviderInterfaceService.cs | 19 +++++++++++-------- .../InterfaceMapPublishService.cs | 4 ++-- .../InterfaceForward.Domain.Shared.csproj | 2 +- .../BasicRepository.cs | 8 ++++---- .../IBasicRepository.cs | 4 ++-- .../InterfaceForward.Repositories.csproj | 2 +- 8 files changed, 25 insertions(+), 22 deletions(-) diff --git a/src/InterfaceForward.Api/InterfaceForward.Api.csproj b/src/InterfaceForward.Api/InterfaceForward.Api.csproj index 9f5a987..d43d7b5 100644 --- a/src/InterfaceForward.Api/InterfaceForward.Api.csproj +++ b/src/InterfaceForward.Api/InterfaceForward.Api.csproj @@ -10,7 +10,7 @@ - + diff --git a/src/InterfaceForward.Application/InterfaceForward.Application.csproj b/src/InterfaceForward.Application/InterfaceForward.Application.csproj index be834f3..3c3d3a4 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/Interface/ServiceProviderInterfaceService.cs b/src/InterfaceForward.Application/Services/Interface/ServiceProviderInterfaceService.cs index f4016ca..2dc308d 100644 --- a/src/InterfaceForward.Application/Services/Interface/ServiceProviderInterfaceService.cs +++ b/src/InterfaceForward.Application/Services/Interface/ServiceProviderInterfaceService.cs @@ -33,7 +33,7 @@ public class ServiceProviderInterfaceService : ApplicationService private IBasicRepository InterfaceMapRepository => LazyServiceProvider.GetRequiredService>(); - + private InterfaceCategoryService InterfaceCategoryService => LazyServiceProvider.GetRequiredService(); @@ -48,12 +48,12 @@ public class ServiceProviderInterfaceService : ApplicationService GetServiceProviderInterfaceTreeListAsync(ServiceProviderInterfaceTreeListInputObjectValue input) { var res = await InterfaceRepository.GetServiceProviderInterfaceListAsync(input); - + var tree = await InterfaceCategoryService.GetCategoryTree(false, res); - + return tree; } - + /// /// 服务商接口分页列表 /// @@ -128,13 +128,12 @@ public class ServiceProviderInterfaceService : ApplicationService /// /// [HttpPost("Interface/SaveServiceProviderInterface")] - public async Task SaveServiceProviderInterfaceAsync(ServiceProviderInterfaceInput input) + public async Task SaveServiceProviderInterfaceAsync(ServiceProviderInterfaceInput input) { switch (input.OptionType) { case OptionType.新增: - await CreateServiceProviderInterfaceAsync(input); - break; + return await CreateServiceProviderInterfaceAsync(input); case OptionType.修改: await UpdateServiceProviderInterfaceAsync(input); break; @@ -146,6 +145,8 @@ public class ServiceProviderInterfaceService : ApplicationService default: throw new ArgumentOutOfRangeException(); } + + return input.Id ?? 0; } @@ -173,7 +174,7 @@ public class ServiceProviderInterfaceService : ApplicationService return true; } - internal async Task CreateServiceProviderInterfaceAsync(ServiceProviderInterfaceInput input) + internal async Task CreateServiceProviderInterfaceAsync(ServiceProviderInterfaceInput input) { // 校验参数合法性 ParameterService.ValidateParameter( @@ -232,6 +233,8 @@ public class ServiceProviderInterfaceService : ApplicationService // 提交事务 ts.Complete(); + + return interfaceId; } private async Task GenerateServiceProviderInterfaceCode(int serviceProviderId) diff --git a/src/InterfaceForward.Application/Services/InterfaceMap/InterfaceMapPublishService.cs b/src/InterfaceForward.Application/Services/InterfaceMap/InterfaceMapPublishService.cs index 1282ac0..ef7fba5 100644 --- a/src/InterfaceForward.Application/Services/InterfaceMap/InterfaceMapPublishService.cs +++ b/src/InterfaceForward.Application/Services/InterfaceMap/InterfaceMapPublishService.cs @@ -23,7 +23,7 @@ public class InterfaceMapPublishService( IInterfaceMapPublishRepository interfaceMapPublishRepository, InterfaceForwardQuery interfaceForwardQuery, IInterfaceMapRepository interfaceMapRepository) - : Fake.Application.ApplicationService + : ApplicationService { private static readonly JsonSerializerSettings Settings = new() { @@ -79,7 +79,7 @@ public class InterfaceMapPublishService( string redisContent = JsonConvert.SerializeObject(cache, Settings); - var differenceContent = CompareTexts(redisContent, dbContent); + var differenceContent = CompareTexts(redisContent, dbContent?? String.Empty); return new InterfaceMapPublishedDifferenceVO { diff --git a/src/InterfaceForward.Domain.Shared/InterfaceForward.Domain.Shared.csproj b/src/InterfaceForward.Domain.Shared/InterfaceForward.Domain.Shared.csproj index d505fe0..e72bee4 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.Repositories/BasicRepository.cs b/src/InterfaceForward.Repositories/BasicRepository.cs index a117f95..f1aaa01 100644 --- a/src/InterfaceForward.Repositories/BasicRepository.cs +++ b/src/InterfaceForward.Repositories/BasicRepository.cs @@ -10,19 +10,19 @@ 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() { return Context.Queryable(); } - public async Task GetFirstAsync(Expression> whereExpression) + public async Task GetFirstAsync(Expression> whereExpression) { return await AsQueryable().FirstAsync(whereExpression); } - public async Task GetFirstAsync(Expression> whereExpression, + public async Task GetFirstAsync(Expression> whereExpression, Expression> resultExpression) { return await Context.Queryable().Where(whereExpression).Select(resultExpression).FirstAsync(); @@ -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/IBasicRepository.cs b/src/InterfaceForward.Repositories/IBasicRepository.cs index b8d8e6d..f74b0cd 100644 --- a/src/InterfaceForward.Repositories/IBasicRepository.cs +++ b/src/InterfaceForward.Repositories/IBasicRepository.cs @@ -13,9 +13,9 @@ public interface IBasicRepository: ISqlSugarRepository /// /// - Task GetFirstAsync(Expression> whereExpression); + Task GetFirstAsync(Expression> whereExpression); - Task GetFirstAsync(Expression> whereExpression,Expression> resultExpression); + Task GetFirstAsync(Expression> whereExpression,Expression> resultExpression); /// /// get list diff --git a/src/InterfaceForward.Repositories/InterfaceForward.Repositories.csproj b/src/InterfaceForward.Repositories/InterfaceForward.Repositories.csproj index f04b915..21e45de 100644 --- a/src/InterfaceForward.Repositories/InterfaceForward.Repositories.csproj +++ b/src/InterfaceForward.Repositories/InterfaceForward.Repositories.csproj @@ -7,7 +7,7 @@ - + From 1ac24689f867cffb267c930ed90748410a037fa1 Mon Sep 17 00:00:00 2001 From: xiaolipro <2357729423@qq.com> Date: Thu, 17 Jul 2025 14:35:17 +0800 Subject: [PATCH 2/2] set pwd --- src/InterfaceForward.Api/appsettings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/InterfaceForward.Api/appsettings.json b/src/InterfaceForward.Api/appsettings.json index d24d7f6..83e47b6 100644 --- a/src/InterfaceForward.Api/appsettings.json +++ b/src/InterfaceForward.Api/appsettings.json @@ -56,7 +56,7 @@ "ElasticSearch": { "NodeUrls": [ "http://129.204.22.146:9200" ], "LoginName": "elastic", - "Password": "afyTgmVb8jq6", + "Password": "itd!@#123", "Base64PassPassword": "Basic ZWxhc3RpYzphZnlUZ21WYjhqcTY=" } }