作者 lyh

gx

@@ -24,8 +24,6 @@ class AiVideoController extends BaseController @@ -24,8 +24,6 @@ class AiVideoController extends BaseController
24 * @time :2025/8/2 11:19 24 * @time :2025/8/2 11:19
25 */ 25 */
26 public function ImageCallBack(){ 26 public function ImageCallBack(){
27 - $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"}';  
28 - $this->param = json_decode($str,true);  
29 $this->saveLog('数据详情:'.json_encode($this->param,true)); 27 $this->saveLog('数据详情:'.json_encode($this->param,true));
30 $count = Redis::decr('ai_video_image'); 28 $count = Redis::decr('ai_video_image');
31 if ($count < 0) { 29 if ($count < 0) {
@@ -40,14 +38,14 @@ class AiVideoController extends BaseController @@ -40,14 +38,14 @@ class AiVideoController extends BaseController
40 //获取当前数据详情 38 //获取当前数据详情
41 $info = $aiVideoAutoLogModel->read(['trigger_id'=>$this->param['trigger_id']]); 39 $info = $aiVideoAutoLogModel->read(['trigger_id'=>$this->param['trigger_id']]);
42 if($info === false){ 40 if($info === false){
43 - $this->saveLog('未获取到当前数据详情。'.$info); 41 + $this->saveLog('未获取到当前数据详情。'.json_encode($info,true));
44 $this->response('success'); 42 $this->response('success');
45 } 43 }
46 //上传图片 返回cdn链接 44 //上传图片 返回cdn链接
47 $cosService = new CosService(); 45 $cosService = new CosService();
48 $imagePath = $cosService->uploadRemote($info['project_id'],'video',$data['url']); 46 $imagePath = $cosService->uploadRemote($info['project_id'],'video',$data['url']);
49 $this->saveLog($imagePath); 47 $this->saveLog($imagePath);
50 -// try { 48 + try {
51 if($imagePath){ 49 if($imagePath){
52 $cos = config('filesystems.disks.cos'); 50 $cos = config('filesystems.disks.cos');
53 $url = $cos['cdn1'].'/'.$imagePath; 51 $url = $cos['cdn1'].'/'.$imagePath;
@@ -61,12 +59,12 @@ class AiVideoController extends BaseController @@ -61,12 +59,12 @@ class AiVideoController extends BaseController
61 } 59 }
62 } 60 }
63 $images = array_merge($images,$info['images']); 61 $images = array_merge($images,$info['images']);
64 - $this->saveLog('返回的数据详情。'.json_encode($images,true)); 62 + $this->saveLog('success->ok');
65 $aiVideoAutoLogModel->edit(['images'=>$images,'result'=>json_encode($this->param,true),'status'=>1],['id'=>$info['id']]); 63 $aiVideoAutoLogModel->edit(['images'=>$images,'result'=>json_encode($this->param,true),'status'=>1],['id'=>$info['id']]);
66 } 64 }
67 -// }catch (\Exception $e){  
68 -// $this->saveLog('上传图片失败,获取到数据详情。'.$e->getMessage());  
69 -// } 65 + }catch (\Exception $e){
  66 + $this->saveLog('上传图片失败,获取到数据详情。'.$e->getMessage());
  67 + }
70 $this->response('success'); 68 $this->response('success');
71 } 69 }
72 70