59 lines
2.1 KiB
Go
59 lines
2.1 KiB
Go
|
|
package data
|
|||
|
|
|
|||
|
|
import (
|
|||
|
|
consts "cid/consts/data"
|
|||
|
|
"gitea.com/red-future/common/beans"
|
|||
|
|
)
|
|||
|
|
|
|||
|
|
// DataFetchLog 数据获取日志实体
|
|||
|
|
type DataFetchLog struct {
|
|||
|
|
beans.SQLBaseDO `orm:",inherit"`
|
|||
|
|
// 关联信息
|
|||
|
|
PlatformId int64 `orm:"platform_id" json:"platformId" description:"平台ID"`
|
|||
|
|
InterfaceId int64 `orm:"interface_id" json:"interfaceId" description:"接口ID"`
|
|||
|
|
RequestId string `orm:"request_id" json:"requestId" description:"请求ID"`
|
|||
|
|
// 执行状态
|
|||
|
|
Status consts.FetchStatus `orm:"status" json:"status" description:"执行状态:pending/running/success/failed/rate_limit"`
|
|||
|
|
StartTime int64 `orm:"start_time" json:"startTime" description:"开始时间(时间戳)"`
|
|||
|
|
EndTime int64 `orm:"end_time" json:"endTime" description:"结束时间(时间戳)"`
|
|||
|
|
Duration int `orm:"duration" json:"duration" description:"执行时长(毫秒)"`
|
|||
|
|
// 请求响应数据
|
|||
|
|
RequestConfig map[string]interface{} `orm:"request_config" json:"requestConfig" description:"请求配置参数"`
|
|||
|
|
ResponseData string `orm:"response_data" json:"responseData" description:"响应数据(JSON)"`
|
|||
|
|
ErrorMessage string `orm:"error_message" json:"errorMessage" description:"错误信息"`
|
|||
|
|
// 重试信息
|
|||
|
|
RetryCount int `orm:"retry_count" json:"retryCount" description:"重试次数"`
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// DataFetchLogCol 数据获取日志表字段定义
|
|||
|
|
type DataFetchLogCol struct {
|
|||
|
|
beans.SQLBaseCol
|
|||
|
|
PlatformId string
|
|||
|
|
InterfaceId string
|
|||
|
|
RequestId string
|
|||
|
|
Status string
|
|||
|
|
StartTime string
|
|||
|
|
EndTime string
|
|||
|
|
Duration string
|
|||
|
|
RequestConfig string
|
|||
|
|
ResponseData string
|
|||
|
|
ErrorMessage string
|
|||
|
|
RetryCount string
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// DataFetchLogCols 数据获取日志表字段常量
|
|||
|
|
var DataFetchLogCols = DataFetchLogCol{
|
|||
|
|
SQLBaseCol: beans.DefSQLBaseCol,
|
|||
|
|
PlatformId: "platform_id",
|
|||
|
|
InterfaceId: "interface_id",
|
|||
|
|
RequestId: "request_id",
|
|||
|
|
Status: "status",
|
|||
|
|
StartTime: "start_time",
|
|||
|
|
EndTime: "end_time",
|
|||
|
|
Duration: "duration",
|
|||
|
|
RequestConfig: "request_config",
|
|||
|
|
ResponseData: "response_data",
|
|||
|
|
ErrorMessage: "error_message",
|
|||
|
|
RetryCount: "retry_count",
|
|||
|
|
}
|