docs: annotate Foundry source and deployment lifecycle in Chinese [skip ci]

This commit is contained in:
2026-11-16 17:52:11 +08:00
parent 30829eeb86
commit 1090591503
123 changed files with 1279 additions and 3 deletions
@@ -1,3 +1,4 @@
// 解散事务:归档直接孩子、提升嵌套孩子的父级、展开文档并修复祖先端口,保留可撤销记录。
package platform
import (
@@ -7,6 +8,7 @@ import (
"time"
)
// dissolveSubgraph 在 v2 编辑权限下收集父/孩子/嵌套孩子及必要祖先,要求所有参与者版本一致。
func (s *service) dissolveSubgraph(w http.ResponseWriter, r *http.Request, project, account string) error {
if r.Method != http.MethodPost {
reject(w, 405, "method_not_allowed")
@@ -64,6 +66,7 @@ func (s *service) dissolveSubgraph(w http.ResponseWriter, r *http.Request, proje
if err != nil {
return err
}
// 孩子保留关系恢复记录但设为归档;其直接嵌套孩子会迁到当前父画布而不是一并归档。
archivedRelation := relation
archivedRelation.Archived = true
changes := []subgraphRelationChange{{Before: relation, After: archivedRelation}}
@@ -108,6 +111,7 @@ func (s *service) dissolveSubgraph(w http.ResponseWriter, r *http.Request, proje
for node := range canvasNodeData(childBefore.Document) {
members = append(members, node)
}
// 祖先若引用将被展开的成员,修复计划保持原外层端口 ID,只更新其逻辑节点/handle。
repair, err := planAncestorPortRepair(r, tx, project, workspace, board, child, account, members, parentBefore.Document)
if err != nil {
return err
@@ -172,11 +176,13 @@ func (s *service) dissolveSubgraph(w http.ResponseWriter, r *http.Request, proje
snapshots[child] = childSnapshot
// Reparent nested children first. The archived child keeps a recovery record,
// while live ownership immediately follows the nodes flattened into the parent.
// 先重挂嵌套关系再归档当前孩子,避免活跃所有权暂时落在已归档父级下。
for i := len(changes) - 1; i >= 0; i-- {
if err = writeSubgraphRelation(r, tx, project, workspace, changes[i].After); err != nil {
return err
}
}
// 即使部分参与者文档未变也推进版本,使所有权变化对客户端的版本向量可见。
updated := []canvasSnapshot{}
versions := map[string]int64{}
for _, id := range participants {