legalgo-BE-go/database/news_model.go

20 lines
693 B
Go
Raw Normal View History

2025-02-26 22:28:19 +08:00
package database
import (
"time"
"github.com/google/uuid"
)
type News struct {
ID uuid.UUID `gorm:"type:uuid;primaryKey" json:"id"`
AuthorID uuid.UUID `gorm:"type:uuid;not null" json:"author_id"`
Title string `gorm:"default:null" json:"title"`
Content string `gorm:"default:null" json:"content"`
IsPremium bool `gorm:"default:false" json:"is_premium"`
Slug string `gorm:"default:null" json:"slug"`
FeaturedImage string `gorm:"default:null" json:"featured_image"`
CreatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"created_at"`
UpdatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"updated_at"`
}