实现GetPlanByID

This commit is contained in:
2025-09-13 14:53:31 +08:00
parent 986bdf15a6
commit 2b431377c1
2 changed files with 50 additions and 3 deletions

View File

@@ -58,9 +58,10 @@ func (Plan) TableName() string {
type SubPlan struct {
gorm.Model
ParentPlanID uint `gorm:"not null;index" json:"parent_plan_id"` // 父计划的ID
ChildPlanID uint `gorm:"not null;index" json:"child_plan_id"` // 子计划的ID (它本身也是一个 Plan)
Order int `gorm:"not null" json:"order"` // 在父计划中的执行顺序
ParentPlanID uint `gorm:"not null;index" json:"parent_plan_id"` // 父计划的ID
ChildPlanID uint `gorm:"not null;index" json:"child_plan_id"` // 子计划的ID (它本身也是一个 Plan)
Order int `gorm:"not null" json:"order"` // 在父计划中的执行顺序
ChildPlan *Plan `gorm:"-" json:"child_plan"` // 完整子计划数据,仅内存中
}
// TableName 自定义 GORM 使用的数据库表名