修改变量名, 规避order关键字

This commit is contained in:
2025-09-13 15:30:10 +08:00
parent 16bc3b08bc
commit cacb9a9b1d
2 changed files with 16 additions and 15 deletions

View File

@@ -58,10 +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"` // 在父计划中的执行顺序
ChildPlan *Plan `gorm:"-" json:"child_plan"` // 完整子计划数据,仅内存中
ParentPlanID uint `gorm:"not null;index" json:"parent_plan_id"` // 父计划的ID
ChildPlanID uint `gorm:"not null;index" json:"child_plan_id"` // 子计划的ID (它本身也是一个 Plan)
ExecutionOrder int `gorm:"not null" json:"execution_order"` // 在父计划中的执行顺序
ChildPlan *Plan `gorm:"-" json:"child_plan"` // 完整子计划数据,仅内存中
}
// TableName 自定义 GORM 使用的数据库表名
@@ -73,12 +73,12 @@ func (SubPlan) TableName() string {
type Task struct {
gorm.Model
PlanID uint `gorm:"not null;index" json:"plan_id"` // 此任务所属计划的ID
Name string `gorm:"not null" json:"name"`
Description string `json:"description"`
Order int `gorm:"not null" json:"order"` // 在计划中的执行顺序
Type TaskType `gorm:"not null" json:"type"` // 任务的类型,对应 task 包中的具体动作
Parameters datatypes.JSON `json:"parameters"` // 任务特定参数的JSON (例如: 设备ID, 值)
PlanID uint `gorm:"not null;index" json:"plan_id"` // 此任务所属计划的ID
Name string `gorm:"not null" json:"name"`
Description string `json:"description"`
ExecutionOrder int `gorm:"not null" json:"execution_order"` // 在计划中的执行顺序
Type TaskType `gorm:"not null" json:"type"` // 任务的类型,对应 task 包中的具体动作
Parameters datatypes.JSON `json:"parameters"` // 任务特定参数的JSON (例如: 设备ID, 值)
}
// TableName 自定义 GORM 使用的数据库表名