package models import ( "time" ) type Topic struct { ID uint64 `json:"id"` Topic string `json:"topic"` Text string `json:"text"` AuthorID string `json:"author_id"` Author *User `json:"-"` ParentID uint64 `json:"parent_id"` Parent *Topic `json:"-"` Permission int `json:"permission"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` DeletedAt *time.Time `json:"deleted_at"` } type Post struct { ID uint64 `json:"id"` Text string `json:"text"` AuthorID string `json:"author_id"` Author *User `json:"-"` ParentID uint64 `json:"parent_id"` Parent *Post `json:"-"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` DeletedAt *time.Time `json:"deleted_at"` Children []*Post `json:"-"` } type Permission int const ( UserPost Permission = iota << 1 UserTopic AdminPost AdminTopic )