package model import "time" // Project 项目:任务的容器。 // // 任务记「做的是哪件事」,项目记「这些事是为谁、按什么规矩做的」—— // 指令是给 AI 的长期上下文,预置的专员/技能/连接器是这个项目默认带上的能力。 // 归属跟 WorkerTask.Owner 同构(全名优先,回退登录名),列表只列自己的。 type Project struct { ID uint `gorm:"primaryKey" json:"id"` Name string `gorm:"size:40;not null" json:"name"` Instruction string `gorm:"type:text" json:"instruction"` TemplateKey string `gorm:"size:64;default:''" json:"template_key"` Owner string `gorm:"size:64;not null;index" json:"owner"` Pinned bool `gorm:"not null;default:false" json:"pinned"` // 建项目时选中的能力,存 JSON 数组字符串。key 各自指向 specialist.key / // skill.key / connector.key —— 只存 key,展示时再去取名字。 SpecialistKeys string `gorm:"type:text" json:"specialist_keys"` SkillKeys string `gorm:"column:skill_keys;type:text" json:"skill_keys"` ConnectorKeys string `gorm:"type:text" json:"connector_keys"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` } func (Project) TableName() string { return "project" }