package model import "time" type Announcement struct { ID uint64 `gorm:"primaryKey" json:"id"` Title string `gorm:"size:255;not null" json:"title"` Content string `gorm:"type:text;not null" json:"content"` Category string `gorm:"size:32;not null;default:'notice'" json:"category"` Priority int `gorm:"not null;default:0" json:"priority"` IsPinned bool `gorm:"not null;default:false" json:"is_pinned"` IsImportant bool `gorm:"not null;default:false" json:"is_important"` ViewCount int `gorm:"not null;default:0" json:"view_count"` Status string `gorm:"size:32;not null;default:'draft'" json:"status"` PublishedAt *time.Time `json:"published_at"` CreatedBy *uint64 `json:"created_by"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` } func (Announcement) TableName() string { return "announcements" }