定义执行历史和执行队列model, 以及基础的增删改查功能
This commit is contained in:
@@ -3,6 +3,7 @@ package models
|
||||
import (
|
||||
"fmt"
|
||||
"sort"
|
||||
"time"
|
||||
|
||||
"gorm.io/datatypes"
|
||||
"gorm.io/gorm"
|
||||
@@ -133,7 +134,11 @@ func (SubPlan) TableName() string {
|
||||
|
||||
// Task 代表计划中的一个任务,具有执行顺序
|
||||
type Task struct {
|
||||
gorm.Model
|
||||
// 手动定义字段以将 ID 类型设置为 int,以匹配 TaskExecutionLog 中的 TaskID
|
||||
ID int `gorm:"primarykey"`
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
DeletedAt gorm.DeletedAt `gorm:"index"` // 保持软删除功能
|
||||
|
||||
PlanID uint `gorm:"not null;index" json:"plan_id"` // 此任务所属计划的ID
|
||||
Name string `gorm:"not null" json:"name"`
|
||||
|
||||
Reference in New Issue
Block a user