Some checks failed
CI / Lint + Build (push) Has been cancelled
变更模型: - Post: 嵌入 BaseModel,移除手动 ID/CreatedAt/UpdatedAt/DeletedAt - Comment: 嵌入 BaseModel,保留 is_deleted 自定义软删除 - Announcement: 嵌入 BaseModel - Category: 嵌入 BaseModel - Folder + FolderItem: 嵌入 BaseModel - CommunityFund: primaryKey → primarykey (统一小写)
17 lines
544 B
Go
17 lines
544 B
Go
package model
|
|
|
|
import "time"
|
|
|
|
// Announcement 公告
|
|
type Announcement struct {
|
|
BaseModel
|
|
|
|
Title string `gorm:"type:varchar(200);not null" json:"title"`
|
|
Content string `gorm:"type:text;not null" json:"content"`
|
|
Type string `gorm:"type:varchar(20);default:info" json:"type"` // info / warning / success / error
|
|
IsActive bool `gorm:"default:true" json:"is_active"`
|
|
StartAt *time.Time `json:"start_at,omitempty"`
|
|
EndAt *time.Time `json:"end_at,omitempty"`
|
|
Sort int `gorm:"default:0" json:"sort"`
|
|
}
|