This commit is contained in:
Antinew 2025-06-19 01:06:57 +08:00
parent 4f3b7733e0
commit 734508c1d8
2 changed files with 8 additions and 4 deletions

View File

@ -31,7 +31,11 @@ public class InterfaceCategoryService(IBasicRepository<InterfaceCategoryEntity>
List<T> datas) where T : HasCategoryId
{
var res = new List<CategoryTreeNode<T>>();
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<T>
{

View File

@ -39,13 +39,13 @@ public class ServiceProviderInterfaceService : ApplicationService
/// <summary>
/// 服务商接口分页列表
/// 服务商接口树形列表
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("Interface/ServiceProviderInterfacePaginatedList")]
[HttpPost("Interface/GetServiceProviderInterfaceTreeListAsync")]
public async Task<List<CategoryTreeNode<ServiceProviderInterfaceTreeListOutputValueObject>>>
ServiceProviderInterfacePaginatedListAsync(ServiceProviderInterfaceTreeListInputObjectValue input)
GetServiceProviderInterfaceTreeListAsync(ServiceProviderInterfaceTreeListInputObjectValue input)
{
var res = await InterfaceRepository.GetServiceProviderInterfaceListAsync(input);