second commit

This commit is contained in:
Rogee
2026-06-04 15:44:48 +08:00
parent 4db6efb3a7
commit 8ac150bc7b
1275 changed files with 286124 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
package model
import (
"encoding/json"
)
// Folder represents a folder within a category for organizing articles.
// Reference: Chatwoot Folder model + P2B M9 spec
type Folder struct {
Base
AccountID uint `gorm:"index;not null" json:"account_id"`
PortalID uint `gorm:"index;not null" json:"portal_id"`
CategoryID uint `gorm:"index;not null" json:"category_id"`
Name string `gorm:"size:255;not null" json:"name"`
ParentID *uint `gorm:"index" json:"parent_id,omitempty"`
CustomAttributes json.RawMessage `gorm:"type:jsonb;serializer:json" json:"custom_attributes"`
Portal Portal `gorm:"foreignKey:PortalID" json:"portal,omitempty"`
Category Category `gorm:"foreignKey:CategoryID" json:"category,omitempty"`
Parent *Folder `gorm:"foreignKey:ParentID" json:"parent,omitempty"`
Articles []Article `gorm:"foreignKey:FolderID" json:"articles,omitempty"`
}
func (Folder) TableName() string { return "folders" }