new page layout

This commit is contained in:
2025-12-10 00:58:38 +00:00
parent 21eeb351c8
commit b6c9d8d80f
13 changed files with 111 additions and 34 deletions

View File

@@ -4,8 +4,8 @@ import "gorm.io/gorm"
type Post struct {
gorm.Model // includes ID, CreatedAt, UpdatedAt, DeletedAt
Title string `gorm:"not null"`
AuthorID uint
Author User `gorm:"foreignKey:AuthorID"`
Content string
Title string `gorm:"not null" json:"title"`
AuthorID uint `json:"-"`
Author User `gorm:"foreignKey:AuthorID" json:"author"`
Content string `json:"content"`
}