|
...
|
...
|
@@ -6,6 +6,7 @@ use App\Helper\Translate; |
|
|
|
use App\Http\Logic\Bside\BaseLogic;
|
|
|
|
use App\Models\Ai\AiBlogAuthor;
|
|
|
|
use App\Models\Ai\AiVideo;
|
|
|
|
use App\Models\AyrShare\AyrShare;
|
|
|
|
use App\Models\Project\AiBlogTask;
|
|
|
|
use App\Models\Project\AiVideoTask;
|
|
|
|
use App\Models\Project\ProjectAiSetting;
|
|
...
|
...
|
@@ -66,8 +67,16 @@ class AiVideoLogic extends BaseLogic |
|
|
|
$aiVideoTaskModel = new AiVideoTask();
|
|
|
|
$aiVideoService = new AiVideoService($this->user['project_id']);
|
|
|
|
$storage = $aiVideoTaskModel->videoSetting()[$this->user['video_setting'] ?? 1];
|
|
|
|
if($storage == 'YOUTUBE'){
|
|
|
|
//查看是否有ayr账号
|
|
|
|
$ayrModel = new AyrShare();
|
|
|
|
$ayrInfo = $ayrModel->read(['project_id'=>$this->param['project_id'],'bind_platforms'=>['like','%"youtube"%'],'profile_key'=>['!=',null]]);
|
|
|
|
if($ayrInfo !== false){
|
|
|
|
$ayrshare_profile_key = $ayrInfo['profile_key'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//todo::获取ayr的key
|
|
|
|
$result = $aiVideoService->createTask($this->param['title'],$this->param['description'],$this->param['images'],$this->param['anchor'] ?? [],$storage);
|
|
|
|
$result = $aiVideoService->createTask($this->param['title'],$this->param['description'],$this->param['images'],$this->param['anchor'] ?? [],$storage,$ayrshare_profile_key ?? '');
|
|
|
|
if($result['status'] == 200){
|
|
|
|
$aiVideoTaskModel->addReturnId(['task_id'=>$result['data']['task_id'],'project_id'=>$this->user['project_id'],'storage'=>$storage]);
|
|
|
|
$id = $this->model->addReturnId(['title'=>$this->param['title'],'task_id'=>$result['data']['task_id'],'description'=>$this->param['description'],'project_id'=>$this->user['project_id'],'images'=>json_encode($this->param['images'],true),'anchor'=>json_encode($this->param['anchor'] ?? [],true)]);
|
...
|
...
|
|