修改model
This commit is contained in:
@@ -38,6 +38,14 @@ const (
|
|||||||
ParamsPlanID = "plan_id"
|
ParamsPlanID = "plan_id"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type PlanStatus uint8
|
||||||
|
|
||||||
|
const (
|
||||||
|
PlanStatusEnabled PlanStatus = 0 // 启用计划
|
||||||
|
PlanStatusDisabled PlanStatus = 1 // 禁用计划
|
||||||
|
PlanStatusStopeed PlanStatus = 2 // 执行完毕
|
||||||
|
)
|
||||||
|
|
||||||
// Plan 代表系统中的一个计划,可以包含子计划或任务
|
// Plan 代表系统中的一个计划,可以包含子计划或任务
|
||||||
type Plan struct {
|
type Plan struct {
|
||||||
gorm.Model
|
gorm.Model
|
||||||
@@ -45,6 +53,9 @@ type Plan struct {
|
|||||||
Name string `gorm:"not null" json:"name"`
|
Name string `gorm:"not null" json:"name"`
|
||||||
Description string `json:"description"`
|
Description string `json:"description"`
|
||||||
ExecutionType PlanExecutionType `gorm:"not null" json:"execution_type"`
|
ExecutionType PlanExecutionType `gorm:"not null" json:"execution_type"`
|
||||||
|
Status PlanStatus `gorm:"default:0" json:"status"` // 计划是否被启动
|
||||||
|
ExecuteNum uint `gorm:"default:0" json:"execute_num"` // 计划预期执行次数
|
||||||
|
ExecuteCount uint `gorm:"default:0" json:"execute_count"` // 执行计数器
|
||||||
|
|
||||||
// 针对 PlanExecutionTypeAutomatic,使用 Cron 表达式定义调度规则
|
// 针对 PlanExecutionTypeAutomatic,使用 Cron 表达式定义调度规则
|
||||||
CronExpression string `json:"cron_expression"`
|
CronExpression string `json:"cron_expression"`
|
||||||
|
|||||||
Reference in New Issue
Block a user