2021-03-31 03:55:19 +00:00
package models
import (
"net"
"time"
)
type Post struct {
ID int ` db:"id" `
// TODO: Document each of these
AuthorID * int ` db:"author_id" `
CategoryID int ` db:"category_id" `
ParentID * int ` db:"parent_id" `
2021-04-25 19:33:22 +00:00
ThreadID * int ` db:"thread_id" ` // TODO: This is only null for posts that are actually static pages. Which probably shouldn't be posts anyway. Plz make not null thanks
2021-03-31 03:55:19 +00:00
CurrentID int ` db:"current_id" `
Depth int ` db:"depth" `
Slug string ` db:"slug" `
2021-04-22 23:02:50 +00:00
AuthorName string ` db:"author_name" ` // TODO: Drop this.
2021-03-31 03:55:19 +00:00
PostDate time . Time ` db:"postdate" `
IP net . IPNet ` db:"ip" `
Sticky bool ` db:"sticky" `
Moderated bool ` db:"moderated" ` // TODO: I'm not sure this is ever meaningfully used. It always seems to be 0 / false?
Hits int ` db:"hits" `
Featured bool ` db:"featured" `
FeatureVotes int ` db:"featurevotes" ` // TODO: Remove this column from the db, it's never used
Preview string ` db:"preview" `
ReadOnly bool ` db:"readonly" `
}
2021-04-23 04:07:44 +00:00
type Parser int
const (
ParserBBCode Parser = 1
ParserCleanHTML = 2
ParserMarkdown = 3
)
type PostVersion struct {
ID int ` db:"id" `
PostID int ` db:"post_id" `
TextRaw string ` db:"text_raw" `
TextParsed string ` db:"text_parsed" `
Parser Parser ` db:"parser" `
EditIP * net . IPNet ` db:"edit_ip" `
EditDate time . Time ` db:"edit_date" `
EditReason string ` db:"edit_reason" `
EditorID * int ` db:"editor_id" `
}