Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
88b2f57cf5 | ||
|
|
dad52efdc5 | ||
|
|
69b04a894d |
@@ -6,10 +6,11 @@ type Article struct {
|
||||
Title string `json:"title"`
|
||||
Sections []ArticleSection `gorm:"serializer:json" json:"sections"`
|
||||
|
||||
Author User `gorm:"foreignKey:AuthorId" json:"author"`
|
||||
Author Profile `gorm:"foreignKey:AuthorId" json:"author"`
|
||||
}
|
||||
|
||||
type ArticleSection struct {
|
||||
Order int `json:"order"`
|
||||
Type string `json:"type"`
|
||||
Content string `json:"content"`
|
||||
}
|
||||
|
||||
8
models/profile.go
Normal file
8
models/profile.go
Normal file
@@ -0,0 +1,8 @@
|
||||
package models
|
||||
|
||||
type Profile struct {
|
||||
Id string `gorm:"primaryKey" json:"id"`
|
||||
Firstname string `json:"firstname"`
|
||||
Lastname string `json:"lastname"`
|
||||
Username string `json:"username"`
|
||||
}
|
||||
Reference in New Issue
Block a user