package model import ( "time" "gorm.io/datatypes" ) // 计划类型 const ( PlanThirtyDay = "thirty_day" PlanAI = "ai" ) // Plan 养宠计划(30 天路线图 / AI 计划) type Plan struct { Base PetID uint `gorm:"index" json:"pet_id"` UserID uint `gorm:"index" json:"user_id"` Kind string `gorm:"size:16;index" json:"kind"` // thirty_day / ai Stage string `gorm:"size:32" json:"stage"` StartDate *time.Time `json:"start_date"` EndDate *time.Time `json:"end_date"` UserInput string `gorm:"size:512" json:"user_input"` Extracted datatypes.JSON `json:"extracted"` // AI 提取信息 CompletionPct int `json:"completion_pct"` Status string `gorm:"size:16;default:active" json:"status"` // active / completed / archived Tasks []PlanTask `gorm:"foreignKey:PlanID" json:"tasks"` } // PlanTask 计划明细项 type PlanTask struct { Base PlanID uint `gorm:"index" json:"plan_id"` Day int `json:"day"` DayLabel string `gorm:"size:32" json:"day_label"` Title string `gorm:"size:128" json:"title"` Description string `gorm:"size:512" json:"description"` SheetType string `gorm:"size:32" json:"sheet_type"` Done bool `json:"done"` }