Files
bh_go_models/models/article.go
2025-10-18 11:57:47 +11:00

17 lines
452 B
Go

package models
type Article struct {
Id string `gorm:"primaryKey" json:"id"`
AuthorId string `gorm:"index" json:"author_id"`
Title string `json:"title"`
Sections []ArticleSection `gorm:"serializer:json" json:"sections"`
Author Profile `gorm:"foreignKey:AuthorId" json:"author"`
}
type ArticleSection struct {
Order int `json:"order"`
Type string `json:"type"`
Content string `json:"content"`
}