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

@@ -75,7 +75,7 @@ type ItemPatch struct {
type DepositResult struct {
DocumentIdentity string
ProjectIdentity string
ProjectIdentity string
}
type SourceRecord struct {
@@ -363,9 +363,9 @@ func (s *Service) DepositItem(userID uint, itemIdentity, projectIdentity string)
if !strings.HasSuffix(strings.ToLower(name), ".md") {
name += ".md"
}
var document models.SaDocument
var document models.SaDocumentTree
err = s.db.Transaction(func(tx *gorm.DB) error {
document = models.SaDocument{
document = models.SaDocumentTree{
ProjectID: project.ID, CreatedBy: userID, Kind: models.DocumentKindFile,
Name: name, NormalizedName: strings.ToLower(name), Extension: ".md",
MimeType: "text/markdown; charset=utf-8", Size: int64(len([]byte(body))),