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=" } } 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 a8777c4..f52dd85 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.Repositories/BasicRepository.cs b/src/InterfaceForward.Repositories/BasicRepository.cs index ef2a684..f1aaa01 100644 --- a/src/InterfaceForward.Repositories/BasicRepository.cs +++ b/src/InterfaceForward.Repositories/BasicRepository.cs @@ -17,12 +17,12 @@ public class BasicRepository : SqlSugarRepository(); } - 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(); 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