作者 lyh

gx

... ... @@ -24,8 +24,6 @@ class AiVideoController extends BaseController
* @time :2025/8/2 11:19
*/
public function ImageCallBack(){
$str = '{"type":"end","id":3383387788,"content":"Top Demanding Applications from China: Leading Products & Companies\uff0cTop Demanding Applications from China: Leading Products & Companies\uff0c4K\uff0c\u9ad8\u6e05 --no logo --ar 16:9","attachments":[{"id":1048093549,"url":"https:\/\/mjcdn.ttapi.io\/attachments\/1401125993464332303\/1401774677432467546\/hugheliot356883_Top_Demanding_Applications_from_China_Leading_P_505cb786-2342-4bc3-9f3f-7b8d5227e38a.png?ex=68917fe6&is=68902e66&hm=faf2f6965425718185a3e6f4a36f654d89277250c99cfbfe8fc2714a13596979&","proxy_url":null,"filename":null,"content_type":"image\/png","width":null,"height":null,"size":null,"ephemeral":null}],"embeds":[],"trigger_id":"3383387788"}';
$this->param = json_decode($str,true);
$this->saveLog('数据详情:'.json_encode($this->param,true));
$count = Redis::decr('ai_video_image');
if ($count < 0) {
... ... @@ -40,14 +38,14 @@ class AiVideoController extends BaseController
//获取当前数据详情
$info = $aiVideoAutoLogModel->read(['trigger_id'=>$this->param['trigger_id']]);
if($info === false){
$this->saveLog('未获取到当前数据详情。'.$info);
$this->saveLog('未获取到当前数据详情。'.json_encode($info,true));
$this->response('success');
}
//上传图片 返回cdn链接
$cosService = new CosService();
$imagePath = $cosService->uploadRemote($info['project_id'],'video',$data['url']);
$this->saveLog($imagePath);
// try {
try {
if($imagePath){
$cos = config('filesystems.disks.cos');
$url = $cos['cdn1'].'/'.$imagePath;
... ... @@ -61,12 +59,12 @@ class AiVideoController extends BaseController
}
}
$images = array_merge($images,$info['images']);
$this->saveLog('返回的数据详情。'.json_encode($images,true));
$this->saveLog('success->ok');
$aiVideoAutoLogModel->edit(['images'=>$images,'result'=>json_encode($this->param,true),'status'=>1],['id'=>$info['id']]);
}
// }catch (\Exception $e){
// $this->saveLog('上传图片失败,获取到数据详情。'.$e->getMessage());
// }
}catch (\Exception $e){
$this->saveLog('上传图片失败,获取到数据详情。'.$e->getMessage());
}
$this->response('success');
}
... ...