mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +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,12 +128,12 @@ func OpenRepoSnapshotDoc(fileID string) (id, rootID, content string, isLargeDoc
|
|||
}
|
||||
|
||||
type LeftRightDiff struct {
|
||||
LeftIndex *entity.Index `json:"leftIndex"`
|
||||
RightIndex *entity.Index `json:"rightIndex"`
|
||||
AddsLeft []*DiffFile `json:"addsLeft"`
|
||||
UpdatesLeft []*DiffFile `json:"updatesLeft"`
|
||||
UpdatesRight []*DiffFile `json:"updatesRight"`
|
||||
RemovesRight []*DiffFile `json:"removesRight"`
|
||||
LeftIndex *DiffIndex `json:"leftIndex"`
|
||||
RightIndex *DiffIndex `json:"rightIndex"`
|
||||
AddsLeft []*DiffFile `json:"addsLeft"`
|
||||
UpdatesLeft []*DiffFile `json:"updatesLeft"`
|
||||
UpdatesRight []*DiffFile `json:"updatesRight"`
|
||||
RemovesRight []*DiffFile `json:"removesRight"`
|
||||
}
|
||||
|
||||
type DiffFile struct {
|
||||
|
|
@ -141,6 +141,11 @@ type DiffFile struct {
|
|||
Title string `json:"title"`
|
||||
}
|
||||
|
||||
type DiffIndex struct {
|
||||
ID string `json:"id"`
|
||||
Created int64 `json:"created"`
|
||||
}
|
||||
|
||||
func DiffRepoSnapshots(left, right string) (ret *LeftRightDiff, err error) {
|
||||
if 1 > len(Conf.Repo.Key) {
|
||||
err = errors.New(Conf.Language(26))
|
||||
|
|
@ -157,12 +162,15 @@ func DiffRepoSnapshots(left, right string) (ret *LeftRightDiff, err error) {
|
|||
return
|
||||
}
|
||||
|
||||
diff.LeftIndex.Files = nil
|
||||
diff.RightIndex.Files = nil
|
||||
|
||||
ret = &LeftRightDiff{
|
||||
LeftIndex: diff.LeftIndex,
|
||||
RightIndex: diff.RightIndex,
|
||||
LeftIndex: &DiffIndex{
|
||||
ID: diff.LeftIndex.ID,
|
||||
Created: diff.LeftIndex.Created,
|
||||
},
|
||||
RightIndex: &DiffIndex{
|
||||
ID: diff.RightIndex.ID,
|
||||
Created: diff.RightIndex.Created,
|
||||
},
|
||||
}
|
||||
luteEngine := NewLute()
|
||||
for _, addLeft := range diff.AddsLeft {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue