diff --git a/models/article.go b/models/article.go new file mode 100644 index 0000000..15898ad --- /dev/null +++ b/models/article.go @@ -0,0 +1,13 @@ +package models + +type Article struct { + Id string `gorm:"primaryKey" json:"id"` + Author User `json:"author"` + Title string `json:"title"` + Sections []ArticleSection `gorm:"serializer:json" json:"sections"` +} + +type ArticleSection struct { + Type string `json:"type"` + Content string `json:"content"` +}