plan增加一个类型字段
This commit is contained in:
		| @@ -52,12 +52,20 @@ const ( | ||||
| 	PlanStatusFailed   PlanStatus = "执行失败" // 执行失败 | ||||
| ) | ||||
|  | ||||
| type PlanType string | ||||
|  | ||||
| const ( | ||||
| 	PlanTypeCustom PlanType = "自定义任务" | ||||
| 	PlanTypeSystem PlanType = "系统任务" | ||||
| ) | ||||
|  | ||||
| // Plan 代表系统中的一个计划,可以包含子计划或任务 | ||||
| type Plan struct { | ||||
| 	gorm.Model | ||||
|  | ||||
| 	Name          string            `gorm:"not null" json:"name"` | ||||
| 	Description   string            `json:"description"` | ||||
| 	PlanType      PlanType          `gorm:"not null;index" json:"plan_type"` // 任务类型, 包括系统任务和用户自定义任务 | ||||
| 	ExecutionType PlanExecutionType `gorm:"not null;index" json:"execution_type"` | ||||
| 	Status        PlanStatus        `gorm:"default:'已禁用';index" json:"status"` // 计划是否被启动 | ||||
| 	ExecuteNum    uint              `gorm:"default:0" json:"execute_num"`      // 计划预期执行次数 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user