- route definition
- Url: /api/v1/jobs
- Method: GET
- Request:
JobListRequest - Response:
JobListResponse
- request definition
type JobListRequest struct {
Status string `form:"status,optional"`
FunctionID string `form:"function_id,optional"`
Actor string `form:"actor,optional"`
GameID string `form:"game_id,optional"`
Env string `form:"env,optional"`
Page int `form:"page,optional,default=1"`
Size int `form:"size,optional,default=20"`
}
- response definition
type JobListResponse struct {
Jobs []JobItem `json:"jobs"`
Total int `json:"total"`
}
- route definition
- Url: /api/v1/jobs
- Method: POST
- Request:
JobStartRequest - Response:
JobStartResponse
- request definition
type JobStartRequest struct {
FunctionID string `json:"functionId"` // 函数ID
Params interface{} `json:"params,optional"`
}
- response definition
type JobStartResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Data interface{} `json:"data,omitempty"`
}
- route definition
- Url: /api/v1/jobs/:id/cancel
- Method: POST
- Request:
JobCancelRequest - Response:
JobCancelResponse
- request definition
type JobCancelRequest struct {
ID string `path:"id"` // 任务ID
}
- response definition
type JobCancelResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Data interface{} `json:"data,omitempty"`
}
- route definition
- Url: /api/v1/jobs/:id/result
- Method: GET
- Request:
JobResultRequest - Response:
JobResultResponse
- request definition
type JobResultRequest struct {
ID string `path:"id"` // 任务ID
}
- response definition
type JobResultResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Data interface{} `json:"data,omitempty"`
}
- route definition
- Url: /api/v1/jobs/:jobId/stream
- Method: GET
- Request:
StreamJobRequest - Response:
StreamJobResponse
- request definition
type StreamJobRequest struct {
JobID string `path:"jobId"`
}
- response definition
type StreamJobResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Data interface{} `json:"data,omitempty"`
}
- Dashboard 仍会调用
/api/v1/function-calls* 读取函数调用历史。 - 当前服务端提供了一个基于
jobs 的兼容层来承接这些请求,详见 function_call.md。 - 该兼容层的目标是消除重构后的 404,不代表已经恢复完整的调用历史持久化模型。