go-learn/domain/post.go

20 lines
279 B
Go
Raw Normal View History

package domain
2025-01-13 16:32:03 +08:00
import (
"gorm.io/gorm"
"time"
)
type Post struct {
2025-01-13 16:32:03 +08:00
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"
}