chore: 初始化提交
This commit is contained in:
commit
943c0a0e5a
71 files changed
+7122
No files matched your search
@@ -0,0 +1,27 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
// 任务状态机固定为以下取值,不要新增中间态。
|
||||
const (
|
||||
TaskStatusPending = "pending"
|
||||
TaskStatusRunning = "running"
|
||||
TaskStatusSucceeded = "succeeded"
|
||||
TaskStatusFailed = "failed"
|
||||
TaskStatusCanceled = "canceled"
|
||||
)
|
||||
|
||||
// Task 一次生成任务。长耗时动作一律走任务表,不阻塞 HTTP 请求。
|
||||
type Task struct {
|
||||
ID string `gorm:"primaryKey;size:64" json:"id"`
|
||||
CanvasID string `gorm:"index;size:64;not null" json:"canvasId"`
|
||||
NodeID string `gorm:"size:64" json:"nodeId"`
|
||||
Kind string `gorm:"size:32;not null" json:"kind"`
|
||||
Status string `gorm:"size:16;not null;index" json:"status"`
|
||||
Progress float64 `json:"progress"`
|
||||
Params JSONMap `gorm:"type:text" json:"params"`
|
||||
Result JSONMap `gorm:"type:text" json:"result,omitempty"`
|
||||
Error string `gorm:"type:text" json:"error,omitempty"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
}
|
||||
Reference in new issue
Block a user