3 Commits
v1.0 ... main

Author SHA1 Message Date
Frederick Holland
88b2f57cf5 Changed article to use Profile instead of User 2025-10-18 11:57:47 +11:00
Frederick Holland
dad52efdc5 Added profile 2025-10-18 11:49:09 +11:00
Frederick Holland
69b04a894d Added order to article section 2025-10-17 22:02:17 +11:00
2 changed files with 10 additions and 1 deletions

View File

@@ -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
View 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"`
}