|
...
|
...
|
@@ -29,21 +29,6 @@ class AiVideoLogic extends BaseLogic |
|
|
|
$this->model = new AiVideo();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :获取配置信息
|
|
|
|
* @name :getProjectAiSetting
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2025/2/21 14:51
|
|
|
|
*/
|
|
|
|
public function getProjectAiSetting(){
|
|
|
|
$projectAiSettingModel = new ProjectAiSetting();
|
|
|
|
$aiSettingInfo = $projectAiSettingModel->read(['project_id'=>$this->user['project_id']]);
|
|
|
|
if($aiSettingInfo === false){
|
|
|
|
$this->fail('请先联系管理员开启Ai配置');
|
|
|
|
}
|
|
|
|
return $aiSettingInfo;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :ai发布博客
|
|
...
|
...
|
@@ -55,10 +40,13 @@ class AiVideoLogic extends BaseLogic |
|
|
|
public function videoSave(){
|
|
|
|
try {
|
|
|
|
$this->param['route'] = RouteMap::setRoute($this->param['route'], RouteMap::SOURCE_AI_VIDEO, $this->param['id'], $this->user['project_id']);
|
|
|
|
$anchor = $this->param['anchor'] ?? [];
|
|
|
|
$this->param['anchor'] = json_encode($this->param['anchor'],true);
|
|
|
|
$this->param['images'] = json_encode($this->param['images'],true);
|
|
|
|
$this->model->edit($this->param,['id'=>$this->param['id']]);
|
|
|
|
$aiVideoService = new AiVideoService($this->user['project_id']);
|
|
|
|
$aiVideoService->updateDetail(['task_id'=>$this->param['task_id'],'title'=>$this->param['title'],
|
|
|
|
'content'=>$this->param['content'] ?? '','video_url'=>$this->param['video_url'],'thumb'=>$this->param['image'],'url'=>$this->param['route'],'author_id'=>$this->param['author_id']]);
|
|
|
|
'content'=>$this->param['content'] ?? '','video_url'=>$this->param['video_url'],'anchor'=>$anchor,'thumb'=>$this->param['image'],'url'=>$this->param['route'],'author_id'=>$this->param['author_id']]);
|
|
|
|
}catch (\Exception $e){
|
|
|
|
$this->fail('保存失败,请联系管理员');
|
|
|
|
}
|
...
|
...
|
|