20 lines
325 B
Go
20 lines
325 B
Go
package model
|
|
|
|
import (
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
type Post struct {
|
|
gorm.Model
|
|
ID uint `gorm:"primarykey" json:"id"`
|
|
Title string `json:"title"`
|
|
TLDR string `json:"tldr"`
|
|
Content string `json:"content"`
|
|
Comments []Comment
|
|
}
|
|
type Comment struct {
|
|
ID uint
|
|
PostID uint
|
|
Content string `json:"content"`
|
|
}
|