mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
🎨 数据快照对比加入时间标识 https://github.com/siyuan-note/siyuan/issues/6899
This commit is contained in:
parent
c949441bfb
commit
0603ed3656
1 changed files with 19 additions and 11 deletions
|
|
@ -128,8 +128,8 @@ func OpenRepoSnapshotDoc(fileID string) (id, rootID, content string, isLargeDoc
|
||||||
}
|
}
|
||||||
|
|
||||||
type LeftRightDiff struct {
|
type LeftRightDiff struct {
|
||||||
LeftIndex *entity.Index `json:"leftIndex"`
|
LeftIndex *DiffIndex `json:"leftIndex"`
|
||||||
RightIndex *entity.Index `json:"rightIndex"`
|
RightIndex *DiffIndex `json:"rightIndex"`
|
||||||
AddsLeft []*DiffFile `json:"addsLeft"`
|
AddsLeft []*DiffFile `json:"addsLeft"`
|
||||||
UpdatesLeft []*DiffFile `json:"updatesLeft"`
|
UpdatesLeft []*DiffFile `json:"updatesLeft"`
|
||||||
UpdatesRight []*DiffFile `json:"updatesRight"`
|
UpdatesRight []*DiffFile `json:"updatesRight"`
|
||||||
|
|
@ -141,6 +141,11 @@ type DiffFile struct {
|
||||||
Title string `json:"title"`
|
Title string `json:"title"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type DiffIndex struct {
|
||||||
|
ID string `json:"id"`
|
||||||
|
Created int64 `json:"created"`
|
||||||
|
}
|
||||||
|
|
||||||
func DiffRepoSnapshots(left, right string) (ret *LeftRightDiff, err error) {
|
func DiffRepoSnapshots(left, right string) (ret *LeftRightDiff, err error) {
|
||||||
if 1 > len(Conf.Repo.Key) {
|
if 1 > len(Conf.Repo.Key) {
|
||||||
err = errors.New(Conf.Language(26))
|
err = errors.New(Conf.Language(26))
|
||||||
|
|
@ -157,12 +162,15 @@ func DiffRepoSnapshots(left, right string) (ret *LeftRightDiff, err error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
diff.LeftIndex.Files = nil
|
|
||||||
diff.RightIndex.Files = nil
|
|
||||||
|
|
||||||
ret = &LeftRightDiff{
|
ret = &LeftRightDiff{
|
||||||
LeftIndex: diff.LeftIndex,
|
LeftIndex: &DiffIndex{
|
||||||
RightIndex: diff.RightIndex,
|
ID: diff.LeftIndex.ID,
|
||||||
|
Created: diff.LeftIndex.Created,
|
||||||
|
},
|
||||||
|
RightIndex: &DiffIndex{
|
||||||
|
ID: diff.RightIndex.ID,
|
||||||
|
Created: diff.RightIndex.Created,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
luteEngine := NewLute()
|
luteEngine := NewLute()
|
||||||
for _, addLeft := range diff.AddsLeft {
|
for _, addLeft := range diff.AddsLeft {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue