2021-03-31 03:55:19 +00:00
|
|
|
package models
|
|
|
|
|
2021-07-30 03:40:47 +00:00
|
|
|
type ThreadType int
|
|
|
|
|
|
|
|
const (
|
2021-07-30 23:08:42 +00:00
|
|
|
ThreadTypeProjectBlogPost ThreadType = iota + 1
|
2021-07-30 03:40:47 +00:00
|
|
|
ThreadTypeForumPost
|
|
|
|
_ // formerly occupied by static pages, RIP
|
|
|
|
_ // formerly occupied by who the hell knows what, RIP
|
|
|
|
_ // formerly occupied by the wiki, RIP
|
|
|
|
_ // formerly occupied by library discussions, RIP
|
2021-07-30 23:08:42 +00:00
|
|
|
ThreadTypePersonalBlogPost
|
2021-07-30 03:40:47 +00:00
|
|
|
)
|
|
|
|
|
2024-06-21 22:40:18 +00:00
|
|
|
var ValidThreadTypes = []ThreadType{
|
|
|
|
ThreadTypeProjectBlogPost,
|
|
|
|
ThreadTypeForumPost,
|
|
|
|
ThreadTypePersonalBlogPost,
|
|
|
|
}
|
|
|
|
|
2021-03-31 03:55:19 +00:00
|
|
|
type Thread struct {
|
|
|
|
ID int `db:"id"`
|
|
|
|
|
2021-07-30 03:40:47 +00:00
|
|
|
Type ThreadType `db:"type"`
|
|
|
|
ProjectID int `db:"project_id"`
|
|
|
|
SubforumID *int `db:"subforum_id"`
|
|
|
|
PersonalArticleUserID *int `db:"personal_article_user_id"`
|
2021-03-31 03:55:19 +00:00
|
|
|
|
2021-07-04 22:48:08 +00:00
|
|
|
Title string `db:"title"`
|
|
|
|
Sticky bool `db:"sticky"`
|
|
|
|
Locked bool `db:"locked"`
|
|
|
|
Deleted bool `db:"deleted"`
|
2021-03-31 03:55:19 +00:00
|
|
|
|
2021-07-30 20:01:40 +00:00
|
|
|
FirstID int `db:"first_id"`
|
|
|
|
LastID int `db:"last_id"`
|
2021-03-31 03:55:19 +00:00
|
|
|
}
|