feat(编辑能力): 接入版本管理并完善编辑隔离
build.yaml / build (push) Successful in 48s

This commit is contained in:
xiaoqidun committed 2026-10-10 21:29:51 +08:00
1 parent 5bc92dddd1
commit 89bbbba46e
4 files changed
+240 -4

No files matched your search

+10
View File
@@ -73,6 +73,7 @@ type pageBoxInfo struct {
// DocumentInfo 文档信息
type DocumentInfo struct {
DocumentIndex int `json:"documentIndex"`
DocumentVersion string `json:"documentVersion"`
Documents []DocumentEntry `json:"documents,omitempty"`
Encryption EncryptionInfo `json:"encryption"`
Version string `json:"version"`
@@ -98,6 +99,14 @@ type DocumentInfo struct {
DetailsPending bool `json:"detailsPending,omitempty"`
}
// VersionEntry 版本管理列表中的入口,空ID表示主文档
type VersionEntry struct {
ID string `json:"id"`
Index int32 `json:"index"`
Name string `json:"name"`
Default bool `json:"default"`
}
// DocumentEntry 包内文档入口,管理列表按需补充元数据和页数
type DocumentEntry struct {
Index int `json:"index"`
@@ -441,6 +450,7 @@ func (s *Session) Summary() DocumentInfo {
Outlines: s.doc.OutlineInfos(),
DetailsPending: true,
}
info.DocumentVersion, _ = s.Reader.DocumentVersionID()
for index, body := range s.Reader.OFD.DocBody {
info.Documents = append(info.Documents, DocumentEntry{Index: index, Title: body.DocInfo.Title, Root: body.DocRoot, ID: body.DocInfo.DocID})
}