From 734508c1d8d844fac6cf1e5814850299976a59b9 Mon Sep 17 00:00:00 2001 From: Antinew <2357729423@qq.com> Date: Thu, 19 Jun 2025 01:06:57 +0800 Subject: [PATCH] temp --- .../Services/Interface/InterfaceCategoryService.cs | 6 +++++- .../Services/Interface/ServiceProviderInterfaceService.cs | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/InterfaceForward.Application/Services/Interface/InterfaceCategoryService.cs b/src/InterfaceForward.Application/Services/Interface/InterfaceCategoryService.cs index beeca88..a6a14b5 100644 --- a/src/InterfaceForward.Application/Services/Interface/InterfaceCategoryService.cs +++ b/src/InterfaceForward.Application/Services/Interface/InterfaceCategoryService.cs @@ -31,7 +31,11 @@ public class InterfaceCategoryService(IBasicRepository List datas) where T : HasCategoryId { var res = new List>(); - foreach (var category in categories.Where(x => x.PId == pId)) + var elements = categories.Where(x => x.PId == pId).ToList(); + if (elements.IsEmpty()) return res; + categories = categories.Except(elements).ToList(); + + foreach (var category in elements) { res.Add(new CategoryTreeNode { diff --git a/src/InterfaceForward.Application/Services/Interface/ServiceProviderInterfaceService.cs b/src/InterfaceForward.Application/Services/Interface/ServiceProviderInterfaceService.cs index 4035292..6f1fc41 100644 --- a/src/InterfaceForward.Application/Services/Interface/ServiceProviderInterfaceService.cs +++ b/src/InterfaceForward.Application/Services/Interface/ServiceProviderInterfaceService.cs @@ -39,13 +39,13 @@ public class ServiceProviderInterfaceService : ApplicationService /// - /// 服务商接口分页列表 + /// 服务商接口树形列表 /// /// /// - [HttpPost("Interface/ServiceProviderInterfacePaginatedList")] + [HttpPost("Interface/GetServiceProviderInterfaceTreeListAsync")] public async Task>> - ServiceProviderInterfacePaginatedListAsync(ServiceProviderInterfaceTreeListInputObjectValue input) + GetServiceProviderInterfaceTreeListAsync(ServiceProviderInterfaceTreeListInputObjectValue input) { var res = await InterfaceRepository.GetServiceProviderInterfaceListAsync(input);