refactor(documents): rename document tree model

This commit is contained in:
2026-07-24 12:23:18 +08:00
parent 1578c81a89
commit ab8ba3c03f
24 changed files with 77 additions and 77 deletions

View File

@@ -10,7 +10,7 @@ import (
func TestSharedPreviewBodySanitizesMarkdownHTMLAndUnsafeLinks(t *testing.T) {
body := sharedPreviewBody(SharedDocument{
Document: models.SaDocument{Name: "shared.md", Extension: ".md"},
Document: models.SaDocumentTree{Name: "shared.md", Extension: ".md"},
Content: &models.SaDocumentContent{
Markdown: "# 标题\n\n<script>alert(1)</script>\n\n[危险链接](javascript:alert(2))",
},
@@ -23,7 +23,7 @@ func TestSharedPreviewBodySanitizesMarkdownHTMLAndUnsafeLinks(t *testing.T) {
func TestSharedPreviewBodyEmbedsSupportedBlobWithoutDownloadLink(t *testing.T) {
body := sharedPreviewBody(SharedDocument{
Document: models.SaDocument{Name: "manual.pdf", Extension: ".pdf", MimeType: "application/pdf"},
Document: models.SaDocumentTree{Name: "manual.pdf", Extension: ".pdf", MimeType: "application/pdf"},
Blob: &models.SaDocumentBlob{StorageKey: "blob"},
}, "https://example.test/content")