|
@@ -25,7 +25,7 @@ class AiVideoController extends BaseController |
|
@@ -25,7 +25,7 @@ class AiVideoController extends BaseController |
|
25
|
* @time :2025/8/2 11:19
|
25
|
* @time :2025/8/2 11:19
|
|
26
|
*/
|
26
|
*/
|
|
27
|
public function ImageCallBack(){
|
27
|
public function ImageCallBack(){
|
|
28
|
- @file_put_contents(storage_path('logs/lyh_error.log'), var_export($this->param, true) . PHP_EOL, FILE_APPEND);
|
28
|
+ $this->saveLog('数据详情:'.json_encode($this->param,true));
|
|
29
|
Log::channel('ai_video')->info('数据详情:'.json_encode($this->param,true));
|
29
|
Log::channel('ai_video')->info('数据详情:'.json_encode($this->param,true));
|
|
30
|
$count = Redis::decr('ai_video_image');
|
30
|
$count = Redis::decr('ai_video_image');
|
|
31
|
if ($count < 0) {
|
31
|
if ($count < 0) {
|
|
@@ -39,11 +39,13 @@ class AiVideoController extends BaseController |
|
@@ -39,11 +39,13 @@ class AiVideoController extends BaseController |
|
39
|
//获取当前数据详情
|
39
|
//获取当前数据详情
|
|
40
|
$info = $aiVideoAutoLogModel->read(['trigger_id'=>$this->param['id']]);
|
40
|
$info = $aiVideoAutoLogModel->read(['trigger_id'=>$this->param['id']]);
|
|
41
|
if($info === false){
|
41
|
if($info === false){
|
|
|
|
42
|
+ @file_put_contents(storage_path('logs/ai_video.log'), var_export($info, true) . PHP_EOL, FILE_APPEND);
|
|
42
|
Log::channel('ai_video')->info('当前数据不存在或已被删除'.$this->param['id']);
|
43
|
Log::channel('ai_video')->info('当前数据不存在或已被删除'.$this->param['id']);
|
|
43
|
}
|
44
|
}
|
|
44
|
//上传图片 返回cdn链接
|
45
|
//上传图片 返回cdn链接
|
|
45
|
$cosService = new CosService();
|
46
|
$cosService = new CosService();
|
|
46
|
$imagePath = $cosService->uploadRemote($info['project_id'],'video',$data['url']);
|
47
|
$imagePath = $cosService->uploadRemote($info['project_id'],'video',$data['url']);
|
|
|
|
48
|
+ @file_put_contents(storage_path('logs/ai_video.log'), var_export($imagePath, true) . PHP_EOL, FILE_APPEND);
|
|
47
|
try {
|
49
|
try {
|
|
48
|
if($imagePath){
|
50
|
if($imagePath){
|
|
49
|
$cos = config('filesystems.disks.cos');
|
51
|
$cos = config('filesystems.disks.cos');
|
|
@@ -66,4 +68,16 @@ class AiVideoController extends BaseController |
|
@@ -66,4 +68,16 @@ class AiVideoController extends BaseController |
|
66
|
}
|
68
|
}
|
|
67
|
$this->response('success');
|
69
|
$this->response('success');
|
|
68
|
}
|
70
|
}
|
|
|
|
71
|
+
|
|
|
|
72
|
+ /**
|
|
|
|
73
|
+ * @remark :保存日志
|
|
|
|
74
|
+ * @name :saveLog
|
|
|
|
75
|
+ * @author :lyh
|
|
|
|
76
|
+ * @method :post
|
|
|
|
77
|
+ * @time :2025/8/4 11:54
|
|
|
|
78
|
+ */
|
|
|
|
79
|
+ public function saveLog($message){
|
|
|
|
80
|
+ @file_put_contents(storage_path('logs/ai_video.log'), var_export($message, true) . PHP_EOL, FILE_APPEND);
|
|
|
|
81
|
+ return true;
|
|
|
|
82
|
+ }
|
|
69
|
} |
83
|
} |