go-learn/domain/post.go

20 lines
279 B
Go

package domain
import (
"gorm.io/gorm"
"time"
)
type Post struct {
ID uint `gorm:"primarykey"`
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt gorm.DeletedAt `gorm:"index"`
Title string
Text string
}
func (Post) TableName() string {
return "post"
}