添加菜单查询
This commit is contained in:
@@ -34,9 +34,9 @@ namespace Yi.Framework.ApiMicroservice.Controllers
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
//暂未制作逻辑删除与多租户的过滤
|
||||
public async Task<List<MenuEntity>> GetMenuTree()
|
||||
public async Task<Result> GetMenuTree()
|
||||
{
|
||||
return await _iMenuService.GetMenuTreeAsync();
|
||||
return Result.Success().SetData(await _iMenuService.GetMenuTreeAsync());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -32,7 +32,7 @@ namespace Yi.Framework.Model.Models
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="MenuCode" )]
|
||||
[SugarColumn(ColumnName= "PermissionCode")]
|
||||
public string PermissionCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Yi.Framework.Service
|
||||
{
|
||||
//ParentId 0,代表为根目录,只能存在一个
|
||||
//复杂查询直接使用db代理
|
||||
return await _repository._Db.Queryable<MenuEntity>().ToTreeAsync(it=>it.Children,it=>it.ParentId,0);
|
||||
return await _repository._Db.Queryable<MenuEntity>().Where(u=>u.IsDeleted==false).ToTreeAsync(it=>it.Children,it=>it.ParentId,0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user