issue-5 #8

Merged
huang merged 13 commits from issue-5 into main 2025-09-21 12:43:59 +08:00
Showing only changes of commit d94a18779e - Show all commits

View File

@@ -38,6 +38,14 @@ const (
ParamsPlanID = "plan_id"
)
type PlanStatus uint8
const (
PlanStatusEnabled PlanStatus = 0 // 启用计划
PlanStatusDisabled PlanStatus = 1 // 禁用计划
PlanStatusStopeed PlanStatus = 2 // 执行完毕
)
// Plan 代表系统中的一个计划,可以包含子计划或任务
type Plan struct {
gorm.Model
@@ -45,6 +53,9 @@ type Plan struct {
Name string `gorm:"not null" json:"name"`
Description string `json:"description"`
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 表达式定义调度规则
CronExpression string `json:"cron_expression"`