Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: 支持数据快照对比 https://github.com/siyuan-note/siyuan/issues/6858

Liang Ding48b36d929f04
diff --git a/kernel/api/repo.go b/kernel/api/repo.go
index 256908ad87..84bf860bb1 100644
--- a/kernel/api/repo.go
+++ b/kernel/api/repo.go
@@ -70,7 +70,10 @@ func diffRepoSnapshots(c *gin.Context) {
}
ret.Data = map[string]interface{}{
- "diff": diff,
+ "addsLeft": diff.AddsLeft,
+ "updatesLeft": diff.UpdatesLeft,
+ "updatesRight": diff.UpdatesRight,
+ "removesRight": diff.RemovesRight,
}
}
diff --git a/kernel/model/repository.go b/kernel/model/repository.go
index 3620edad4f..ff2f8b77c8 100644
--- a/kernel/model/repository.go
+++ b/kernel/model/repository.go
@@ -128,10 +128,10 @@ func OpenRepoSnapshotDoc(fileID string) (id, rootID, content string, isLargeDoc
}
type LeftRightDiff struct {
- AddsLeft []*DiffFile
- UpdatesLeft []*DiffFile
- UpdatesRight []*DiffFile
- RemovesRight []*DiffFile
+ AddsLeft []*DiffFile `json:"addsLeft"`
+ UpdatesLeft []*DiffFile `json:"updatesLeft"`
+ UpdatesRight []*DiffFile `json:"updatesRight"`
+ RemovesRight []*DiffFile `json:"removesRight"`
}
type DiffFile struct {