Files
gochat/internal/model/folder.go.txt
T
2026-06-04 15:44:48 +08:00

25 lines
924 B
Plaintext

package model
import (
"time"
"gorm.io/gorm"
)
// Folder represents a content folder within a portal.
// Reference: Chatwoot Folder model + P2B M9 spec
type Folder struct {
ID uint `gorm:"primaryKey" json:"id"`
PortalID uint `gorm:"not null;index" json:"portal_id"`
Name string `gorm:"size:255;not null" json:"name"`
Slug string `gorm:"size:255;not null;index" json:"slug"`
Position int `gorm:"default:0" json:"position"`
CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at"`
UpdatedAt time.Time `gorm:"autoUpdateTime" json:"updated_at"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"deleted_at,omitempty"`
Portal Portal `gorm:"foreignKey:PortalID" json:"portal,omitempty"`
Articles []Article `gorm:"foreignKey:FolderID" json:"articles,omitempty"`
}
func (Folder) TableName() string { return "folders" }