Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Node ¶
type Node struct { ID base.ID `gorm:"type:bigint;primaryKey;not null"` ParentID null.ID `gorm:"type:bigint;not null;default:0"` // An unique name for this node, or empty. Name null.String `gorm:"unique;default:null"` // The display name for this node Title string `gorm:"not null"` // If the node is created by a user, this field will be filled. UserID null.ID `gorm:"type:bigint;not null;default:0"` ThreadsCount int64 `gorm:"not null;default:0"` AvatarURL string `gorm:"not null"` Description string `gorm:"not null"` CreatedAt time.Time DeletedAt time.Time }
A node (forum) contains many threads (posts), and could be nested.
type Thread ¶
type Thread struct { ID base.ID `gorm:"type:bigint;primaryKey;not null"` NodeID base.ID `gorm:"type:bigint;not null;default:0"` // 0 means that it's a "root" thread. ReplyForID null.ID `gorm:"type:bigint;not null;default:0"` RepliesCount int64 `gorm:"type:bigint;not null;default:0"` UserID base.ID `gorm:"type:bigint;not null;default:0"` // An unique name for this thread, or empty. Name null.String `gorm:"unique;default:null"` Title string `gorm:"not null"` Content string `gorm:"not null"` Abstract string `gorm:"not null"` // auto populated from content ImagesURL string `gorm:"not null"` CreatedAt time.Time `gorm:"not null"` UpdatedAt time.Time `gorm:"not null"` DeletedAt *time.Time }
A thread(post) belongs to a special node, contains user-generated content, and can be nested ( reply ).
func ListThreads ¶
Click to show internal directories.
Click to hide internal directories.