fix 返回Editable

This commit is contained in:
2024-03-05 18:32:48 +08:00
parent 5008f1dc6a
commit 001f28c4c3
2 changed files with 8 additions and 3 deletions

View File

@@ -23,6 +23,11 @@ public class GainfoGroupTreeResponse
/// </summary> /// </summary>
public string Remark { get; set; } public string Remark { get; set; }
/// <summary>
/// 是否编辑
/// </summary>
public bool Editable { get; set; }
[JsonIgnore] [JsonIgnore]
public string TenantId { get; set; } public string TenantId { get; set; }

View File

@@ -22,14 +22,14 @@ public class GainfoGroupService : IGainfoGroupService
public async Task<List<GainfoGroupTreeResponse>> GetTreeAsync() public async Task<List<GainfoGroupTreeResponse>> GetTreeAsync()
{ {
var deviceGroups = await _dbContext.Queryable<GainfoGroupEntity>() var gainfoGroups = await _dbContext.Queryable<GainfoGroupEntity>()
.Select<GainfoGroupTreeResponse>() .Select<GainfoGroupTreeResponse>()
.ToListAsync(); .ToListAsync();
var tops = deviceGroups.Where(x => !x.PCode.HasValue).ToList(); var tops = gainfoGroups.Where(x => !x.PCode.HasValue).ToList();
tops.ForEach(x => tops.ForEach(x =>
{ {
RecursionGetNext(x, deviceGroups); RecursionGetNext(x, gainfoGroups);
}); });
return tops; return tops;