新增 TakeBusinessFields、WriteBusinessFields、SetByPath 与 GetByPath 等工具,支持按映射路径写入请求体与解析响应,并更新相关依赖。
55 lines
2.4 KiB
Go
55 lines
2.4 KiB
Go
package entity
|
|
|
|
import (
|
|
"gitea.redpowerfuture.com/red-future/common/beans"
|
|
)
|
|
|
|
type modelTaskStartCol struct {
|
|
beans.SQLBaseCol
|
|
ModelId string
|
|
BizName string
|
|
MsgTopic string
|
|
RetryCount string
|
|
RequestPath string
|
|
OriginalRequestPath string
|
|
ResponseParams string
|
|
OriginalResponseParams string
|
|
DurationSeconds string
|
|
TaskId string
|
|
MediaType string
|
|
ErrorMsg string
|
|
}
|
|
|
|
var ModelTaskStartCol = modelTaskStartCol{
|
|
SQLBaseCol: beans.DefSQLBaseCol,
|
|
ModelId: "model_id",
|
|
BizName: "biz_name",
|
|
MsgTopic: "msg_topic",
|
|
RetryCount: "retry_count",
|
|
RequestPath: "request_path",
|
|
OriginalRequestPath: "original_request_path",
|
|
ResponseParams: "response_params",
|
|
OriginalResponseParams: "original_response_params",
|
|
DurationSeconds: "duration_seconds",
|
|
TaskId: "task_id",
|
|
MediaType: "media_type",
|
|
ErrorMsg: "error_msg",
|
|
}
|
|
|
|
// ModelTaskStart 模型网关任务
|
|
type ModelTaskStart struct {
|
|
beans.SQLBaseDO `orm:",inline"`
|
|
ModelId int64 `orm:"model_id" json:"modelId" dc:"模型ID"`
|
|
BizName string `orm:"biz_name" json:"bizName" dc:"业务名称"`
|
|
MsgTopic string `orm:"msg_topic" json:"msgTopic" dc:"消息主题"`
|
|
RetryCount int `orm:"retry_count" json:"retryCount" dc:"重试"`
|
|
RequestPath string `orm:"request_path" json:"requestPath" dc:"请求参数保存路径"`
|
|
OriginalRequestPath string `orm:"original_request_path" json:"originalRequestPath" dc:"原始请求参数保存路径"`
|
|
ResponseParams map[string]any `orm:"response_params" json:"responseParams" dc:"响应结果"`
|
|
OriginalResponseParams map[string]any `orm:"original_response_params" json:"originalResponseParams" dc:"原始响应结果"`
|
|
DurationSeconds int64 `orm:"duration_seconds" json:"durationSeconds" dc:"耗时(秒)"`
|
|
TaskId string `orm:"task_id" json:"taskId" dc:"任务ID"`
|
|
MediaType string `orm:"media_type" json:"mediaType" dc:"输入媒体类型快照(audio/no_video/has_video,创建任务时按请求体推导)"`
|
|
ErrorMsg string `orm:"error_msg" json:"errorMsg" dc:"错误消息"`
|
|
}
|