feat(gateway): 添加计费日期字段到回调请求体
- 在CallbackPayload结构体中添加BillingDate字段 - 将任务的BillingData赋值给回调请求体的BillingDate - 保持现有回调功能的其他字段不变
This commit is contained in:
@@ -77,11 +77,12 @@ func UploadByTask(ctx context.Context, data []byte, fileExt string) (oss *Upload
|
||||
|
||||
// CallbackPayload 回调请求体
|
||||
type CallbackPayload struct {
|
||||
TaskId string `json:"task_id"`
|
||||
State int `json:"state"`
|
||||
OssFile string `json:"oss_file"`
|
||||
FileType string `json:"file_type"`
|
||||
ErrorMsg string `json:"error_msg"`
|
||||
TaskId string `json:"task_id"`
|
||||
State int `json:"state"`
|
||||
OssFile string `json:"oss_file"`
|
||||
FileType string `json:"file_type"`
|
||||
ErrorMsg string `json:"error_msg"`
|
||||
BillingDate map[string]any `json:"billing_data"`
|
||||
}
|
||||
|
||||
// TriggerCallback 任务的回调
|
||||
@@ -104,6 +105,7 @@ func TriggerCallback(ctx context.Context, t *entity.ModelGatewayTask) {
|
||||
if !g.IsEmpty(t.ResultFile) {
|
||||
payload.OssFile = t.ResultFile.OssFile
|
||||
payload.FileType = t.ResultFile.FileType
|
||||
payload.BillingDate = t.BillingData
|
||||
}
|
||||
jsonData, err := json.Marshal(payload)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user