32 lines
1.4 KiB
Go
32 lines
1.4 KiB
Go
package model
|
|
|
|
import "time"
|
|
|
|
// Task 任务信息
|
|
type Task struct {
|
|
ID string `json:"id"`
|
|
Type string `json:"type"` // novel, video
|
|
Capability string `json:"capability"` // capability_key
|
|
Action string `json:"action"` // action_key
|
|
Status string `json:"status"` // CREATED, QUEUED, RUNNING, SUCCESS, FAILED, CANCELED
|
|
ThreadID string `json:"thread_id"` // 短剧会话ID
|
|
AssetID string `json:"asset_id"` // 资产ID
|
|
RunID string `json:"run_id"` // 幂等键
|
|
Input map[string]interface{} `json:"input"` // 输入参数
|
|
Output map[string]interface{} `json:"output"` // 输出结果
|
|
ErrorCode string `json:"error_code"` // 错误码
|
|
ErrorMsg string `json:"error_msg"` // 错误信息
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
ElapsedSec int64 `json:"elapsed_sec"` // 耗时秒
|
|
Usage map[string]interface{} `json:"usage"` // 计费信息
|
|
}
|
|
|
|
// APIResponse 通用API响应
|
|
type APIResponse struct {
|
|
Code string `json:"code"`
|
|
Message string `json:"message"`
|
|
RequestID string `json:"request_id"`
|
|
Data map[string]interface{} `json:"data"`
|
|
}
|