the ai video generating for KeLing is ready

This commit is contained in:
RockYang
2025-03-05 14:19:20 +08:00
parent b1fb16995a
commit f580f671a3
10 changed files with 754 additions and 1347 deletions

View File

@@ -257,6 +257,33 @@ func (h *VideoHandler) List(c *gin.Context) {
if item.VideoURL == "" {
item.VideoURL = v.WaterURL
}
// 解析任务详情
if item.Type == types.VideoKeLing {
task := types.VideoTask{}
err = utils.JsonDecode(v.TaskInfo, &task)
if err != nil {
continue
}
var params types.KeLingVideoParams
err = utils.JsonDecode(utils.JsonEncode(task.Params), &params)
if err != nil {
continue
}
item.RawData = map[string]interface{}{
"task_type": params.TaskType,
"model": params.Model,
"cfg_scale": params.CfgScale,
"mode": params.Mode,
"aspect_ratio": params.AspectRatio,
"duration": params.Duration,
"model_name": fmt.Sprintf("%s_%s_%s", params.Model, params.Mode, params.Duration),
}
// 如果视频URL不为空则设置为生成成功
if item.VideoURL != "" {
item.Progress = 100
}
}
items = append(items, item)
}