Files
Docker/CloudBuilder/CloudBuilder.Master/Data/FamilyTreeStatisticsData.cs
T
2026-10-23 09:46:48 +08:00

38 lines
1.5 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using CloudBuilder.Core.Authorization;
namespace CloudBuilder.Master.Data
{
/// <summary>
/// 族谱「统计」tab 的聚合数据:总数/男/女/世代层数 + 各世代人数分布。
/// 后端单次遍历算完(族员表 + 亲子边表 + 始祖 BFS),避免前端拉全表再算;
/// 世代 = 始祖起 BFS 深度(始祖=1 世),未连到始祖的旁支不入世代桶,只计入 Total。
/// </summary>
[TypeScript]
public class FamilyTreeStatisticsData
{
/// <summary>入树成员总数(family_person 按 TreeId 过滤后的行数)</summary>
public int Total { get; set; }
/// <summary>男性族员数(Gender=M)</summary>
public int Male { get; set; }
/// <summary>女性族员数(Gender=W,GenderPolicy 里女= W 而非 F)</summary>
public int Female { get; set; }
/// <summary>世代层数(本谱出现过的最大世代号;空谱为 0)</summary>
public int GenerationCount { get; set; }
/// <summary>各世代人数分布(按世代升序;空档世代也占位,图表柱不连续)</summary>
public FamilyTreeGenerationCountData[] PerGeneration { get; set; } = [];
}
/// <summary>单个世代的人数条目(世代号 + 该世代族员数)</summary>
[TypeScript]
public class FamilyTreeGenerationCountData
{
public int Generation { get; set; }
public int Count { get; set; }
}
}