This commit is contained in:
owenchen committed 2026-10-20 15:44:56 +08:00
1 parent 9b01c4a57a
commit 6417562c4f
37 files changed
+2767 -202

No files matched your search

@@ -0,0 +1,62 @@
using CloudBuilder.Master.Entity;
using System;
namespace CloudBuilder.Master.Data
{
/// <summary>
/// 族谱全系/小系导出的明文数据(按 D1-D8 决策):
/// 后端按权限闸裁剪后下发,前端用「用户密码⊕系统因子」派生密钥加密成 .fm 信封,落盘/上传交换目录
/// </summary>
public class FamilyTreeExchangeData
{
/// <summary>ALL=全系 / SUB=小系</summary>
public string Scope { get; set; } = FamilyTreeExchangeScope.ALL;
public FamilyTreeEntity FamilyTree { get; set; }
public FamilyPersonEntity[] Persons { get; set; } = [];
public FamilyTreeSpouseMapEntity[] SpouseMaps { get; set; } = [];
public FamilyTreeChildrenMapEntity[] ChildrenMaps { get; set; } = [];
/// <summary>
/// 本谱权限行快照(仅备份 BK 写入,用于还原时权限随谱回滚形成绝对闭环;
/// .fm 交换文件恒为空——防成员账号名随导出文件外泄,也防外部文件携权限行劫持本谱)
/// </summary>
public FamilyTreePermissionEntity[] Permissions { get; set; } = [];
public int PersonCount => Persons?.Length ?? 0;
/// <summary>SUB 导出时的锚点人号(二期支系替换导入靠它验明同一人;ALL 为空)</summary>
public string AnchorPersonId { get; set; } = "";
/// <summary>导出发起人(service.UserId)</summary>
public string ExportedBy { get; set; } = "";
public DateTime ExportedAt { get; set; } = DateTime.Now;
}
/// <summary>交换目录下 .fm 密文文件的列表信息(文件名按 D1 规则反解析出 scope/treeId/锚点)</summary>
public class FamilyTreeExchangeFileInfo
{
public string FileName { get; set; } = "";
public long Size { get; set; }
public DateTime LastModified { get; set; }
public string Scope { get; set; } = "";
public string TreeId { get; set; } = "";
public string AnchorPersonId { get; set; } = "";
}
/// <summary>导出范围常量(后端无 CloudBuilder.Master.Service 引用,DTO 与 Policy 各留一份避免工程反向依赖)</summary>
public static class FamilyTreeExchangeScope
{
public const string ALL = "ALL";
public const string SUB = "SUB";
}
}