Commit f5efc586 authored by 刘小敏's avatar 刘小敏

AI试戴生成视频队列程序优化

parent 056d3466
...@@ -172,9 +172,8 @@ class AiTryon extends Common ...@@ -172,9 +172,8 @@ class AiTryon extends Common
*/ */
public function genVideo() public function genVideo()
{ {
if (!$this->request->isPost()) { if (!$this->request->isPost()) {
$this->error(''); $this->error('请用post方式请求');
} }
$params = $this->request->only([ $params = $this->request->only([
...@@ -184,7 +183,8 @@ class AiTryon extends Common ...@@ -184,7 +183,8 @@ class AiTryon extends Common
$user = auth_user(); $user = auth_user();
\think\Queue::push('\addons\shopro\job\AiVideoGen@save', ['taskid' => 'cgt-20260430190444-vmb4q', 'user' => $user], 'shopro-high'); \think\Queue::push('\addons\shopro\job\AiVideoGen@save', ['taskid' => 'cgt-20260506113558-x6wtq', 'user' => $user], 'shopro-high');
$this->success('推送队列成功');
exit; exit;
$userService = new User(); $userService = new User();
...@@ -232,32 +232,4 @@ class AiTryon extends Common ...@@ -232,32 +232,4 @@ class AiTryon extends Common
} }
} }
/**
* AI试戴 查询视频生成状态
*/
public function getGenVideoTask()
{
// curl -X GET https://ark.cn-beijing.volces.com/api/v3/contents/generations/tasks/{id} \
// -H "Content-Type: application/json" \
// -H "Authorization: Bearer $ARK_API_KEY"
}
/**
* AI试戴视频回调函数
* 更新 AI试戴视频结果状态
*/
public function updateAiTryonStatus()
{
// 记录日志
// Log::info('TASKS ID:'. $taskId .' AI生成视频回调函数接口返回:'.json_encode($result));
// // 更新表状态
// $aiTryonModel = new AiTryOnModel();
// $aiTryonModel::where('ai_task_id' , $taskId)->update(['ai_status' => 1]);
}
} }
...@@ -924,3 +924,10 @@ if (!function_exists('operate_disabled')) { ...@@ -924,3 +924,10 @@ if (!function_exists('operate_disabled')) {
} }
} }
// 调试输出
if (!function_exists('debug_echo')) {
function debug_echo($text='')
{
echo PHP_EOL . '------' . $text . '------' . PHP_EOL ;
}
}
This diff is collapsed.
...@@ -112,7 +112,7 @@ class Ai ...@@ -112,7 +112,7 @@ class Ai
try { try {
// 合成AI图片 // 合成AI图片
$resGenImg = $this->generateImage($params, $userId, $response_format = 'url'); $resGenImg = $this->generateImage($params, $userId, 'url');
if ($resGenImg['code'] == 0) { if ($resGenImg['code'] == 0) {
return $resGenImg; return $resGenImg;
} }
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment