AiVideoController.php
1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
/**
* @remark :
* @name :AiVideoController.php
* @author :lyh
* @method :post
* @time :2025/8/2 11:18
*/
namespace App\Http\Controllers\Api;
use App\Enums\Common\Code;
use App\Models\Project\AiVideoAutoLog;
use App\Services\CosService;
use Illuminate\Support\Facades\Log;
class AiVideoController extends BaseController
{
/**
* @remark :回调方法
* @name :ImageCallBack
* @author :lyh
* @method :post
* @time :2025/8/2 11:19
*/
public function ImageCallBack(){
$data = $this->param['attachments'] ?? [];
$aiVideoAutoLogModel = new AiVideoAutoLog();
if(empty($data) || empty($data['url'])){
$aiVideoAutoLogModel->edit(['status'=>9,'result'=>json_encode($this->param,true)],['trigger_id'=>$this->param['id']]);
}
//获取当前数据详情
$info = $aiVideoAutoLogModel->read(['trigger_id'=>$this->param['id']]);
if($info === false){
Log::channel('ai_video')->info('当前数据不存在或已被删除'.$this->param['id']);
}
$cosService = new CosService();
$imagePath = $cosService->uploadRemote(1,'video',$data['url']);
if($imagePath){
//裁剪图片为4张
}else{
Log::channel('ai_video')->info('上传图片失败');
}
$this->response('success');
}
}