dto

package
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 7, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiResponse

type ApiResponse struct {
	TraceID string      `json:"trace_id"`              // 与日志系统对齐
	Code    int         `json:"code" example:"200"`    // 业务错误码
	Message string      `json:"msg" example:"success"` // 提示信息
	Data    interface{} `json:"data"`                  // 数据负载
}

ApiResponse 统一响应结构

type CancelTaskReq

type CancelTaskReq struct {
	TaskID int64 `form:"task_id" json:"task_id" binding:"required"`
}

type ChildResumeSpec

type ChildResumeSpec struct {
	ChildTaskID   int64             `json:"child_task_id" binding:"required"`
	ResumeFrom    string            `json:"resume_from,omitempty"`
	Patches       []RuntimePatchDTO `json:"patches,omitempty"`
	OverrideInput map[string]any    `json:"override_input,omitempty"`
}

ChildResumeSpec 指定一个子任务的恢复策略。

type ChildTaskDTO

type ChildTaskDTO struct {
	TaskID       int64  `json:"task_id"`
	Status       string `json:"status"`
	MapIndex     *int   `json:"map_index,omitempty"`
	ErrorMessage string `json:"error_message,omitempty"`
	RetryCount   int    `json:"retry_count"`
	CreatedAt    int64  `json:"created_at"`
	UpdatedAt    int64  `json:"updated_at"`
}

ChildTaskDTO 是返回给 UI 的子任务精简视图。

type ChildTaskInfo

type ChildTaskInfo struct {
	Child           ChildTaskDTO                 `json:"child"`
	Nodes           []*domain.NodeRuntime        `json:"nodes"`
	NodeDefinitions []*definition.NodeDefinition `json:"node_definitions"`
}

ChildTaskInfo 包含子任务、节点运行时和节点定义,供 UI 展示节点选择器。

type CreateWorkflowReq

type CreateWorkflowReq struct {
	Name        string `json:"name" binding:"required"`
	Description string `json:"description"`
}

type FieldDiffDTO

type FieldDiffDTO struct {
	Path     string `json:"path"`
	Change   string `json:"change"` // added/removed/modified
	OldValue any    `json:"old_value,omitempty"`
	NewValue any    `json:"new_value,omitempty"`
}

type ForkTaskReq

type ForkTaskReq struct {
	OverrideInput map[string]any `json:"override_input,omitempty"`
	ResumeSpec    *ResumeSpecReq `json:"resume_spec,omitempty"`
	EditAction    string         `json:"edit_action,omitempty"`
	EditLabel     string         `json:"edit_label,omitempty"`
}

ForkTaskReq Fork 任务请求

type ForkTaskResp

type ForkTaskResp struct {
	TaskID     int64   `json:"task_id"`
	ForkedFrom int64   `json:"forked_from"`
	Status     string  `json:"status"`
	BaseRunID  int64   `json:"base_run_id"`
	RunDepth   int     `json:"run_depth"`
	ResumeFrom *string `json:"resume_from,omitempty"`
}

ForkTaskResp Fork 任务响应

type GetChildrenByNodeResp

type GetChildrenByNodeResp struct {
	NodeName string          `json:"node_name"`
	Children []ChildTaskInfo `json:"children"`
}

GetChildrenByNodeResp 是查询某个节点下所有子任务的响应。

type NodeReq

type NodeReq struct {
	Name string `json:"name" binding:"required"`
}

type PageRequest

type PageRequest struct {
	Page     int    `form:"page" json:"page" validate:"min=1"`                   // 校验页码≥1
	PageSize int    `form:"page_size" json:"page_size" validate:"min=1,max=100"` // 每页≤100
	Sort     string `form:"sort" json:"sort"`
	Order    string `form:"order" json:"order" validate:"oneof=asc desc"` // 只能是 asc/desc
}

func (*PageRequest) GetLimit

func (p *PageRequest) GetLimit() int

func (*PageRequest) Offset

func (p *PageRequest) Offset() int

type PatchPreviewReq

type PatchPreviewReq struct {
	ResumeFrom    string            `json:"resume_from"`
	Patches       []RuntimePatchDTO `json:"patches" binding:"required"`
	OverrideInput map[string]any    `json:"override_input,omitempty"`
}

type PatchPreviewResp

type PatchPreviewResp struct {
	Valid   bool              `json:"valid"`
	Message string            `json:"message,omitempty"`
	RunPlan RunPlanPreviewDTO `json:"run_plan"`
}

type ResumeSpecReq

type ResumeSpecReq struct {
	ResumeFrom string            `json:"resume_from"`
	Patches    []RuntimePatchDTO `json:"patches,omitempty"`
}

ResumeSpecReq 恢复执行的规格说明

type ResumeSpecSummaryDTO

type ResumeSpecSummaryDTO struct {
	ResumeFrom string `json:"resume_from"`
	PatchCount int    `json:"patch_count"`
}

type ResumeTaskReq

type ResumeTaskReq struct {
	TaskID       int64             `form:"task_id" json:"task_id" binding:"required"`
	ResumeFrom   string            `json:"resume_from,omitempty"`
	Patches      []RuntimePatchDTO `json:"patches,omitempty"`
	ChildResumes []ChildResumeSpec `json:"child_resumes,omitempty"`
}

type RunAwaitBindingDTO

type RunAwaitBindingDTO struct {
	ID                  int64                   `json:"id"`
	TaskID              int64                   `json:"task_id"`
	RootTaskID          int64                   `json:"root_task_id"`
	NodeName            string                  `json:"node_name"`
	WorkflowVersionID   int64                   `json:"workflow_version_id"`
	AwaitType           string                  `json:"await_type"`
	Source              string                  `json:"source"`
	Status              string                  `json:"status"`
	Provider            *string                 `json:"provider,omitempty"`
	ProviderTaskID      *string                 `json:"provider_task_id,omitempty"`
	APITaskID           *string                 `json:"api_task_id,omitempty"`
	ExternalTaskID      *string                 `json:"external_task_id,omitempty"`
	SignalName          *string                 `json:"signal_name,omitempty"`
	MessageName         *string                 `json:"message_name,omitempty"`
	CallbackToken       *string                 `json:"callback_token,omitempty"`
	Correlation         map[string]any          `json:"correlation,omitempty"`
	Config              map[string]any          `json:"config,omitempty"`
	LastEventID         *string                 `json:"last_event_id,omitempty"`
	LastEventSource     *string                 `json:"last_event_source,omitempty"`
	LastEventPayload    map[string]any          `json:"last_event_payload,omitempty"`
	ResultPayload       map[string]any          `json:"result_payload,omitempty"`
	ErrorMessage        string                  `json:"error_message,omitempty"`
	FallbackPollEnabled bool                    `json:"fallback_poll_enabled"`
	FallbackPollTool    *string                 `json:"fallback_poll_tool,omitempty"`
	PollAttempts        int                     `json:"poll_attempts"`
	MaxPollAttempts     int                     `json:"max_poll_attempts"`
	LastPolledAt        *time.Time              `json:"last_polled_at,omitempty"`
	NextPollAt          *time.Time              `json:"next_poll_at,omitempty"`
	WaitingStartedAt    *time.Time              `json:"waiting_started_at,omitempty"`
	TimeoutAt           *time.Time              `json:"timeout_at,omitempty"`
	CompletedAt         *time.Time              `json:"completed_at,omitempty"`
	FailedAt            *time.Time              `json:"failed_at,omitempty"`
	CanceledAt          *time.Time              `json:"canceled_at,omitempty"`
	CreatedAt           time.Time               `json:"created_at"`
	UpdatedAt           time.Time               `json:"updated_at"`
	StatusCategory      string                  `json:"status_category"`
	StatusLabel         string                  `json:"status_label"`
	WaitingFor          string                  `json:"waiting_for,omitempty"`
	NextAction          string                  `json:"next_action,omitempty"`
	IsTerminal          bool                    `json:"is_terminal"`
	CorrelationKeys     []string                `json:"correlation_keys,omitempty"`
	EventSummary        RunAwaitEventSummaryDTO `json:"event_summary"`
	PollSummary         RunAwaitPollSummaryDTO  `json:"poll_summary"`
}

type RunAwaitEventSummaryDTO

type RunAwaitEventSummaryDTO struct {
	LastSource      *string  `json:"last_source,omitempty"`
	HasLastPayload  bool     `json:"has_last_payload"`
	LastPayloadKeys []string `json:"last_payload_keys,omitempty"`
	HasResult       bool     `json:"has_result"`
	ResultKeys      []string `json:"result_keys,omitempty"`
}

type RunAwaitPollSummaryDTO

type RunAwaitPollSummaryDTO struct {
	Enabled      bool       `json:"enabled"`
	Tool         *string    `json:"tool,omitempty"`
	Attempts     int        `json:"attempts"`
	MaxAttempts  int        `json:"max_attempts"`
	LastPolledAt *time.Time `json:"last_polled_at,omitempty"`
	NextPollAt   *time.Time `json:"next_poll_at,omitempty"`
	IsDue        bool       `json:"is_due"`
	HasCapacity  bool       `json:"has_capacity"`
}

type RunDAGDTO

type RunDAGDTO struct {
	Nodes          []RunDAGNodeDTO `json:"nodes"`
	Edges          []RunDAGEdgeDTO `json:"edges"`
	ActivatedEdges map[string]bool `json:"activated_edges"`
	Stats          RunDAGStatsDTO  `json:"stats"`
}

RunDAGDTO Run Inspector 左边 DAG 面板的核心。

type RunDAGEdgeDTO

type RunDAGEdgeDTO struct {
	From      string `json:"from"`
	To        string `json:"to"`
	Activated bool   `json:"activated"`
	Type      string `json:"type,omitempty"`
	Condition string `json:"condition,omitempty"`
	CaseKey   string `json:"case_key,omitempty"`
	Label     string `json:"label,omitempty"`
	Priority  int    `json:"priority,omitempty"`
}

type RunDAGNodeDTO

type RunDAGNodeDTO struct {
	Name         string            `json:"name"`
	Label        string            `json:"label,omitempty"`
	Type         string            `json:"type"`
	Version      string            `json:"version,omitempty"`
	Config       map[string]any    `json:"config,omitempty"`
	InputMapping map[string]string `json:"input_mapping,omitempty"`

	GroupKind   string `json:"group_kind,omitempty"` // map / subworkflow / branch
	GroupID     string `json:"group_id,omitempty"`
	Parallelism int    `json:"parallelism,omitempty"`

	State             string  `json:"state"`
	Action            string  `json:"action"`
	ExecutionReason   string  `json:"execution_reason,omitempty"`
	ReuseKind         string  `json:"reuse_kind,omitempty"`
	IsInjected        bool    `json:"is_injected"`
	IsDirty           bool    `json:"is_dirty"`
	DirtyReason       string  `json:"dirty_reason,omitempty"`
	IsPatched         bool    `json:"is_patched"`
	IsResumeBoundary  bool    `json:"is_resume_boundary"`
	HasCheckpoint     bool    `json:"has_checkpoint"`
	HasOutput         bool    `json:"has_output"`
	Progress          float64 `json:"progress"`
	Index             int     `json:"index"`
	BizIndex          int     `json:"biz_index"`
	Weight            float64 `json:"weight"`
	ParentTaskID      *int64  `json:"parent_task_id,omitempty"`
	ReusedFromTaskID  *int64  `json:"reused_from_task_id,omitempty"`
	ReusedFromNode    *string `json:"reused_from_node,omitempty"`
	PatchCount        int     `json:"patch_count"`
	MapItemReuse      []int   `json:"map_item_reuse,omitempty"`
	ResolvedInputHash string  `json:"input_hash,omitempty"`
	OutputHash        string  `json:"output_hash,omitempty"`

	MapSummary         *RunMapSummaryDTO         `json:"map_summary,omitempty"`
	SubworkflowSummary *RunSubworkflowSummaryDTO `json:"subworkflow_summary,omitempty"`

	Meta map[string]any `json:"meta,omitempty"`
}

type RunDAGStatsDTO

type RunDAGStatsDTO struct {
	TotalNodes    int `json:"total_nodes"`
	SuccessNodes  int `json:"success_nodes"`
	FailedNodes   int `json:"failed_nodes"`
	RunningNodes  int `json:"running_nodes"`
	SkippedNodes  int `json:"skipped_nodes"`
	PatchedNodes  int `json:"patched_nodes"`
	ReusedNodes   int `json:"reused_nodes"`
	ExecutedNodes int `json:"executed_nodes"`
}

type RunInspectorResp

type RunInspectorResp struct {
	Run           RunSummaryDTO         `json:"run"`
	Workflow      WorkflowSummaryDTO    `json:"workflow"`
	DAG           RunDAGDTO             `json:"dag"`
	Snapshot      RunSnapshotDTO        `json:"snapshot"`
	Lineage       *RunLineageSummaryDTO `json:"lineage,omitempty"`
	Patches       []RuntimePatchDTO     `json:"patches,omitempty"`
	Resume        *ResumeSpecSummaryDTO `json:"resume,omitempty"`
	AwaitBindings []RunAwaitBindingDTO  `json:"await_bindings,omitempty"`
}

type RunLineageSummaryDTO

type RunLineageSummaryDTO struct {
	BaseRunID      int64   `json:"base_run_id"`
	ForkedFrom     *int64  `json:"forked_from,omitempty"`
	AncestorRunIDs []int64 `json:"ancestor_run_ids,omitempty"`
	ChildRunIDs    []int64 `json:"child_run_ids,omitempty"`
}

type RunMapSummaryDTO

type RunMapSummaryDTO struct {
	ItemCount     int    `json:"item_count"`
	Parallelism   int    `json:"parallelism"`
	SuccessCount  int    `json:"success_count"`
	RunningCount  int    `json:"running_count"`
	FailedCount   int    `json:"failed_count"`
	ReuseCount    int    `json:"reuse_count"`
	ChildWorkflow string `json:"child_workflow,omitempty"`
	Expandable    bool   `json:"expandable"`
}

type RunNodeDetailDTO

type RunNodeDetailDTO struct {
	Name         string            `json:"name"`
	Label        string            `json:"label,omitempty"`
	Type         string            `json:"type"`
	Version      string            `json:"version,omitempty"`
	Config       map[string]any    `json:"config,omitempty"`
	InputMapping map[string]string `json:"input_mapping,omitempty"`

	State           string          `json:"state"`
	Action          string          `json:"action"`
	ExecutionReason string          `json:"execution_reason,omitempty"`
	ReuseKind       string          `json:"reuse_kind,omitempty"`
	IsInjected      bool            `json:"is_injected"`
	IsDirty         bool            `json:"is_dirty"`
	DirtyReason     string          `json:"dirty_reason,omitempty"`
	InputHash       string          `json:"input_hash,omitempty"`
	OutputHash      string          `json:"output_hash,omitempty"`
	ResolvedInput   map[string]any  `json:"resolved_input,omitempty"`
	Output          map[string]any  `json:"output,omitempty"`
	Checkpoint      map[string]any  `json:"checkpoint,omitempty"`
	ActivatedEdges  map[string]bool `json:"activated_edges,omitempty"`
	Error           string          `json:"error,omitempty"`
	StartedAt       *time.Time      `json:"started_at,omitempty"`
	FinishedAt      *time.Time      `json:"finished_at,omitempty"`
	LastHeartbeat   *time.Time      `json:"last_heartbeat,omitempty"`
	CheckpointedAt  *time.Time      `json:"checkpointed_at,omitempty"`
	Progress        float64         `json:"progress"`
	Meta            map[string]any  `json:"meta,omitempty"`
}

type RunNodeDetailResp

type RunNodeDetailResp struct {
	Run          RunSummaryDTO         `json:"run"`
	Node         RunNodeDetailDTO      `json:"node"`
	Parent       *RunNodeParentDTO     `json:"parent,omitempty"`
	Patches      []RuntimePatchDTO     `json:"patches,omitempty"`
	Timeline     []RunTimelineEventDTO `json:"timeline,omitempty"`
	Diff         *RunNodeDiffDTO       `json:"diff,omitempty"`
	AwaitBinding *RunAwaitBindingDTO   `json:"await_binding,omitempty"`
}

type RunNodeDiffDTO

type RunNodeDiffDTO struct {
	BaseTaskID     *int64         `json:"base_task_id,omitempty"`
	BaseNodeName   string         `json:"base_node_name,omitempty"`
	InputDiff      []FieldDiffDTO `json:"input_diff,omitempty"`
	OutputDiff     []FieldDiffDTO `json:"output_diff,omitempty"`
	CheckpointDiff []FieldDiffDTO `json:"checkpoint_diff,omitempty"`
	PlanDiff       []FieldDiffDTO `json:"plan_diff,omitempty"`
}

type RunNodeExpansionEdgeDTO

type RunNodeExpansionEdgeDTO struct {
	ID          string `json:"id"`
	FromNodeID  string `json:"from_node_id"`
	ToNodeID    string `json:"to_node_id"`
	Kind        string `json:"kind"` // normal / condition / fan_out / fan_in / item_flow / virtual
	IsActivated bool   `json:"is_activated"`
	Label       string `json:"label,omitempty"`
	Condition   string `json:"condition,omitempty"`
	CaseKey     string `json:"case_key,omitempty"`
	Priority    int    `json:"priority,omitempty"`
}

type RunNodeExpansionGroupDTO

type RunNodeExpansionGroupDTO struct {
	ID      string   `json:"id"`
	Title   string   `json:"title"`
	Kind    string   `json:"kind"` // workflow / map / subworkflow / item_lane / branch_lane
	NodeIDs []string `json:"node_ids"`
}

type RunNodeExpansionItemDTO

type RunNodeExpansionItemDTO struct {
	ItemIndex    int    `json:"item_index"`
	ItemKey      string `json:"item_key,omitempty"`
	DisplayTitle string `json:"display_title,omitempty"`
	State        string `json:"state"`
	ChildRunID   *int64 `json:"child_run_id,omitempty"`
}

type RunNodeExpansionItemRefDTO

type RunNodeExpansionItemRefDTO struct {
	ItemIndex    int    `json:"item_index"`
	ItemKey      string `json:"item_key,omitempty"`
	DisplayTitle string `json:"display_title,omitempty"`
}

type RunNodeExpansionNodeDTO

type RunNodeExpansionNodeDTO struct {
	ID       string  `json:"id"`
	Name     string  `json:"name"`
	Title    string  `json:"title,omitempty"`
	Kind     string  `json:"kind"`      // start/end/tool/map/subworkflow/virtual_fan_out...
	NodeType string  `json:"node_type"` // 原始类型
	State    string  `json:"state"`
	Action   string  `json:"action"`
	Progress float64 `json:"progress"`

	SourceNodeName string `json:"source_node_name,omitempty"`

	ExecutionReason  string `json:"execution_reason,omitempty"`
	ReuseKind        string `json:"reuse_kind,omitempty"`
	IsInjected       bool   `json:"is_injected"`
	IsDirty          bool   `json:"is_dirty"`
	IsPatched        bool   `json:"is_patched"`
	IsResumeBoundary bool   `json:"is_resume_boundary"`
	HasCheckpoint    bool   `json:"has_checkpoint"`
	HasOutput        bool   `json:"has_output"`
	InputHash        string `json:"input_hash,omitempty"`
	OutputHash       string `json:"output_hash,omitempty"`

	ItemContext *RunNodeExpansionItemRefDTO `json:"item_context,omitempty"`
}

type RunNodeExpansionResp

type RunNodeExpansionResp struct {
	ParentNodeName    string                     `json:"parent_node_name"`
	Kind              string                     `json:"kind"` // map / subworkflow
	ChildWorkflowName string                     `json:"child_workflow_name,omitempty"`
	ChildRunID        *int64                     `json:"child_run_id,omitempty"`
	ItemCount         *int                       `json:"item_count,omitempty"`
	Items             []RunNodeExpansionItemDTO  `json:"items,omitempty"`
	Nodes             []RunNodeExpansionNodeDTO  `json:"nodes"`
	Edges             []RunNodeExpansionEdgeDTO  `json:"edges"`
	Groups            []RunNodeExpansionGroupDTO `json:"groups,omitempty"`
}

type RunNodeParentDTO

type RunNodeParentDTO struct {
	TaskID        int64          `json:"task_id"`
	NodeName      string         `json:"node_name"`
	State         string         `json:"state"`
	InputHash     string         `json:"input_hash,omitempty"`
	OutputHash    string         `json:"output_hash,omitempty"`
	ResolvedInput map[string]any `json:"resolved_input,omitempty"`
	Output        map[string]any `json:"output,omitempty"`
	Checkpoint    map[string]any `json:"checkpoint,omitempty"`
}

type RunPlanNodePreviewDTO

type RunPlanNodePreviewDTO struct {
	Name              string `json:"name"`
	Label             string `json:"label,omitempty"`
	Type              string `json:"type"`
	Action            string `json:"action"`
	Reason            string `json:"reason,omitempty"`
	ReuseKind         string `json:"reuse_kind,omitempty"`
	IsPatched         bool   `json:"is_patched"`
	IsResumeBoundary  bool   `json:"is_resume_boundary"`
	HasFailedChildren bool   `json:"has_failed_children"`
	MapItemReuse      []int  `json:"map_item_reuse,omitempty"`
}

type RunPlanPreviewDTO

type RunPlanPreviewDTO struct {
	Mode         string                   `json:"mode"`
	ResumeFrom   string                   `json:"resume_from,omitempty"`
	ParentTaskID *int64                   `json:"parent_task_id,omitempty"`
	Summary      RunPlanPreviewSummaryDTO `json:"summary"`
	Nodes        []RunPlanNodePreviewDTO  `json:"nodes"`
}

type RunPlanPreviewSummaryDTO

type RunPlanPreviewSummaryDTO struct {
	ExecuteCount        int `json:"execute_count"`
	ReuseCount          int `json:"reuse_count"`
	PatchCount          int `json:"patch_count"`
	ResumeBoundaryCount int `json:"resume_boundary_count"`
}

type RunRedoReq

type RunRedoReq struct {
	ResumeFrom    string            `json:"resume_from" binding:"required"`
	Patches       []RuntimePatchDTO `json:"patches,omitempty"`
	OverrideInput map[string]any    `json:"override_input,omitempty"`
	EditAction    string            `json:"edit_action" binding:"required"`
	EditLabel     string            `json:"edit_label,omitempty"`
	Note          string            `json:"note,omitempty"`
}

type RunRedoResp

type RunRedoResp struct {
	TaskID       int64  `json:"task_id"`
	Status       string `json:"status"`
	ParentTaskID int64  `json:"parent_task_id"`
	ResumeFrom   string `json:"resume_from,omitempty"`
}

type RunSnapshotDTO

type RunSnapshotDTO struct {
	Input map[string]any `json:"input"`
	Final map[string]any `json:"final,omitempty"`
}

type RunSubworkflowSummaryDTO

type RunSubworkflowSummaryDTO struct {
	ChildRunID    *int64 `json:"child_run_id,omitempty"`
	ChildWorkflow string `json:"child_workflow,omitempty"`
	Status        string `json:"status,omitempty"`
	Expandable    bool   `json:"expandable"`
}

type RunSummaryDTO

type RunSummaryDTO struct {
	TaskID        int64      `json:"task_id"`
	RootID        int64      `json:"root_id"`
	BaseRunID     int64      `json:"base_run_id"`
	ForkedFrom    *int64     `json:"forked_from,omitempty"`
	RunDepth      int        `json:"run_depth"`
	Status        string     `json:"status"`
	Progress      float64    `json:"progress"`
	Type          string     `json:"type"`
	StartedAt     *time.Time `json:"started_at,omitempty"`
	CreatedAt     *time.Time `json:"created_at,omitempty"`
	UpdatedAt     *time.Time `json:"updated_at,omitempty"`
	ErrorMessage  string     `json:"error_message,omitempty"`
	EditAction    *string    `json:"edit_action,omitempty"`
	EditLabel     *string    `json:"edit_label,omitempty"`
	ResumeFrom    *string    `json:"resume_from,omitempty"`
	WorkflowID    int64      `json:"workflow_id"`
	WorkflowVerID int64      `json:"workflow_version_id"`
}

type RunTimelineEventDTO

type RunTimelineEventDTO struct {
	ID        int64          `json:"id"`
	TaskID    int64          `json:"task_id"`
	NodeName  string         `json:"node_name,omitempty"`
	Phase     string         `json:"phase"` // planning/materialization/execution
	Type      string         `json:"type"`  // node_planned/node_patched/node_running...
	Title     string         `json:"title"`
	Message   string         `json:"message,omitempty"`
	Level     string         `json:"level,omitempty"`
	Progress  float64        `json:"progress,omitempty"`
	CreatedAt time.Time      `json:"created_at"`
	Meta      map[string]any `json:"meta,omitempty"`
}

type RunWorkflowReq

type RunWorkflowReq struct {
	WorkflowName string         `json:"workflow_name" binding:"required"`
	Input        map[string]any `json:"input"`
}

type RuntimePatchDTO

type RuntimePatchDTO struct {
	Target string `json:"target"`
	Node   string `json:"node"`
	Path   string `json:"path"`
	Op     string `json:"op"`
	Value  any    `json:"value,omitempty"`
	Label  string `json:"label,omitempty"`
}

type SecurityToolReq

type SecurityToolReq struct {
	Text   string `json:"text" binding:"required"`
	Action string `json:"action" binding:"required,oneof=encrypt decrypt"` // encrypt 或 decrypt
}

SecurityToolReq 用于测试加密解密工具的请求结构

type SecurityToolRes

type SecurityToolRes struct {
	Action string `json:"action"`
	Result string `json:"result"`
}

type Task

type Task struct {
	ID       int64   `json:"id"`
	UserID   int64   `json:"user_id"`
	Status   string  `json:"status"`
	Type     string  `json:"type"`
	Progress float64 `json:"progress"`

	EntryType     *string `json:"entry_type"`
	EntryTitle    *string `json:"entry_title"`
	EntrySubtitle *string `json:"entry_subtitle"`
	RouteKey      *string `json:"route_key"`
	ModeKey       *string `json:"mode_key"`

	Input  map[string]any     `json:"input"`
	Result *domain.TaskOutput `json:"result"`

	ErrorMessage *string `json:"error_message"`

	CreatedAt int64 `json:"created_at"`
	UpdatedAt int64 `json:"updated_at"`
}

Task 是发布中心列表使用的轻量任务读取模型

type TaskDetail

type TaskDetail struct {
	ID       int64   `json:"id"`
	UserID   int64   `json:"user_id"`
	Status   string  `json:"status"`
	Type     string  `json:"type"`
	Progress float64 `json:"progress"`

	EntryType     *string `json:"entry_type"`
	EntryTitle    *string `json:"entry_title"`
	EntrySubtitle *string `json:"entry_subtitle"`
	RouteKey      *string `json:"route_key"`
	ModeKey       *string `json:"mode_key"`

	Input map[string]any `json:"input"`

	Result *domain.TaskOutput `json:"result"`

	ErrorMessage *string `json:"error_message"`

	RetryCount int `json:"retry_count"`

	CreatedAt int64 `json:"created_at"`
	UpdatedAt int64 `json:"updated_at"`
}

type TaskListReq

type TaskListReq struct {
	Page     int    `form:"page"`
	PageSize int    `form:"page_size"`
	Keyword  string `form:"keyword"`

	// pending / running / success / failed / suspended
	Status string `form:"status"`

	// tool / template / workflow
	EntryType string `form:"entry_type"`

	// video / image / audio
	ResultType string `form:"result_type"`

	RouteKey string `form:"route_key"`
	ModeKey  string `form:"mode_key"`

	// 支持逗号分隔的多个排除 key,例如:?exclude_route_keys=dream_studio,other_key
	ExcludeRouteKeys string `form:"exclude_route_keys"` // 接收 "a,b,c"
	ExcludeModeKeys  string `form:"exclude_mode_keys"`  // 接收 "a,b,c"

	// all / unpublished / asset_published / asset_bound / template_published
	PublishState string `form:"publish_state"`

	OnlySuccess *bool `form:"only_success"`
}

TaskListReq 管理后台任务发布中心列表请求

type TaskListResp

type TaskListResp struct {
	Items    []*Task `json:"items"`
	Total    int64   `json:"total"`
	Page     int     `json:"page"`
	PageSize int     `json:"page_size"`
}

type TaskSummary

type TaskSummary struct {
	Task            *domain.Task                 `json:"task"`
	Nodes           []*domain.NodeRuntime        `json:"nodes"`
	NodeDefinitions []*definition.NodeDefinition `json:"node_definitions"`
}

type UserNodeDataDTO

type UserNodeDataDTO struct {
	Name         string            `json:"name"`
	Label        string            `json:"label,omitempty"`
	Type         string            `json:"type"`
	State        string            `json:"state"`
	InputMapping map[string]string `json:"input_mapping"`
	Output       map[string]any    `json:"output"`
}

UserNodeDataDTO 用户侧节点可编辑数据(轻量版)。 GET /user/works/:id/nodes/:node

type WorkflowSummaryDTO

type WorkflowSummaryDTO struct {
	WorkflowID  int64  `json:"workflow_id"`
	Name        string `json:"name"`
	VersionID   int64  `json:"version_id"`
	Version     int64  `json:"version"`
	Description string `json:"description,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL