17 lines
452 B
Go
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"`
|
|
}
|