作者 李宇航

合并分支 'lyh-server' 到 'master'

gxai创建项目



查看合并请求 !1962
@@ -177,7 +177,7 @@ class AiBlogAutoPublish extends Command @@ -177,7 +177,7 @@ class AiBlogAutoPublish extends Command
177 if (!AiBlogOpenLog::isOpened($project->id)) { 177 if (!AiBlogOpenLog::isOpened($project->id)) {
178 //创建AI博客项目 178 //创建AI博客项目
179 $deploy_optimize = $project->deploy_optimize; 179 $deploy_optimize = $project->deploy_optimize;
180 - (new ProjectLogic())->setAiBlog($project->id, $project->main_lang_id, 1, $project->company, $deploy_optimize->company_en_name, $deploy_optimize->company_en_description); 180 + (new ProjectLogic())->setAiBlog($project->id, $project->main_lang_id, 1, $project->company, $deploy_optimize->company_en_name, $deploy_optimize->company_en_description,$project->is_related_video ?? 0);
181 181
182 //开启 182 //开启
183 $project->is_ai_blog = 1; 183 $project->is_ai_blog = 1;
@@ -176,7 +176,7 @@ class ProjectLogic extends BaseLogic @@ -176,7 +176,7 @@ class ProjectLogic extends BaseLogic
176 //ai_blog 176 //ai_blog
177 $this->setAiBlog($this->param['id'],$this->param['main_lang_id'],$this->param['is_ai_blog'] ?? 0, 177 $this->setAiBlog($this->param['id'],$this->param['main_lang_id'],$this->param['is_ai_blog'] ?? 0,
178 $this->param['company']??"", $this->param['deploy_optimize']['company_en_name'] ?? '', 178 $this->param['company']??"", $this->param['deploy_optimize']['company_en_name'] ?? '',
179 - $this->param['deploy_optimize']['company_en_description'] ?? '',$this->param['is_ai_video'] ?? 0); 179 + $this->param['deploy_optimize']['company_en_description'] ?? '',$this->param['is_ai_video'] ?? 0,$this->param['is_related_video'] ?? 0);
180 //保存项目信息 180 //保存项目信息
181 $this->saveProject($this->param); 181 $this->saveProject($this->param);
182 //保存建站部署信息 182 //保存建站部署信息
@@ -289,7 +289,7 @@ class ProjectLogic extends BaseLogic @@ -289,7 +289,7 @@ class ProjectLogic extends BaseLogic
289 * @method :post 289 * @method :post
290 * @time :2025/2/13 16:02 290 * @time :2025/2/13 16:02
291 */ 291 */
292 - public function setAiBlog($project_id,$main_lang_id,$is_ai_blog,$company,$company_en_name,$company_en_description,$is_ai_video = 0){ 292 + public function setAiBlog($project_id,$main_lang_id,$is_ai_blog,$company,$company_en_name,$company_en_description,$is_ai_video = 0,$is_related_video = 0){
293 if(empty($main_lang_id) || (empty($is_ai_blog) && empty($is_ai_video))){ 293 if(empty($main_lang_id) || (empty($is_ai_blog) && empty($is_ai_video))){
294 return true; 294 return true;
295 } 295 }
@@ -305,7 +305,7 @@ class ProjectLogic extends BaseLogic @@ -305,7 +305,7 @@ class ProjectLogic extends BaseLogic
305 $aiSettingInfo = $aiSettingModel->read(['project_id'=>$project_id]); 305 $aiSettingInfo = $aiSettingModel->read(['project_id'=>$project_id]);
306 if($aiSettingInfo === false){ 306 if($aiSettingInfo === false){
307 $aiBlogService = new AiBlogService(); 307 $aiBlogService = new AiBlogService();
308 - $result = $aiBlogService->createProject($projectInfo['company']?:$projectInfo['title'],$languageInfo['short'],$company_en_description,$company_en_name); 308 + $result = $aiBlogService->createProject($projectInfo['company']?:$projectInfo['title'],$languageInfo['short'],$company_en_description,$company_en_name,$is_related_video);
309 if(isset($result['status']) && $result['status'] == 200){ 309 if(isset($result['status']) && $result['status'] == 200){
310 //查看当前项目是否已有记录 310 //查看当前项目是否已有记录
311 $resData = [ 311 $resData = [
@@ -323,7 +323,7 @@ class ProjectLogic extends BaseLogic @@ -323,7 +323,7 @@ class ProjectLogic extends BaseLogic
323 $aiBlogService = new AiBlogService(); 323 $aiBlogService = new AiBlogService();
324 $aiBlogService->mch_id = $aiSettingInfo['mch_id']; 324 $aiBlogService->mch_id = $aiSettingInfo['mch_id'];
325 $aiBlogService->key = $aiSettingInfo['key']; 325 $aiBlogService->key = $aiSettingInfo['key'];
326 - $aiBlogService->updatedProject($projectInfo['company']?:$projectInfo['title'],$languageInfo['short'],$company_en_description,$company_en_name); 326 + $aiBlogService->updatedProject($projectInfo['company']?:$projectInfo['title'],$languageInfo['short'],$company_en_description,$company_en_name,$is_related_video);
327 } 327 }
328 } 328 }
329 return true; 329 return true;
@@ -57,10 +57,10 @@ class AiBlogService @@ -57,10 +57,10 @@ class AiBlogService
57 * @method :post 57 * @method :post
58 * @time :2025/2/13 14:28 58 * @time :2025/2/13 14:28
59 */ 59 */
60 - public function createProject($project_name,$language,$profile,$company){ 60 + public function createProject($project_name,$language,$profile,$company,$is_related_video){
61 $request_url = $this->url.'api/project/create'; 61 $request_url = $this->url.'api/project/create';
62 $param = [ 62 $param = [
63 - 'mch_id'=>$this->mch_id, 'title'=>$project_name, 'language'=>$language, 'profile'=>$profile, 'company'=>$company, 63 + 'mch_id'=>$this->mch_id, 'title'=>$project_name, 'language'=>$language, 'profile'=>$profile, 'company'=>$company,'is_related_video'=>$is_related_video
64 ]; 64 ];
65 $this->sign = $this->generateSign($param,$this->key); 65 $this->sign = $this->generateSign($param,$this->key);
66 $param['sign'] = $this->sign; 66 $param['sign'] = $this->sign;
@@ -75,9 +75,9 @@ class AiBlogService @@ -75,9 +75,9 @@ class AiBlogService
75 * @method :post 75 * @method :post
76 * @time :2025/2/13 14:35 76 * @time :2025/2/13 14:35
77 */ 77 */
78 - public function updatedProject($project_name,$language,$profile,$company){ 78 + public function updatedProject($project_name,$language,$profile,$company,$is_related_video){
79 $request_url = $this->url.'api/project/save'; 79 $request_url = $this->url.'api/project/save';
80 - $param = ['mch_id'=>$this->mch_id, 'title'=>$project_name, 'language'=>$language, 'profile'=>$profile, 'company'=>$company]; 80 + $param = ['mch_id'=>$this->mch_id, 'title'=>$project_name, 'language'=>$language, 'profile'=>$profile, 'company'=>$company,'is_related_video'=>$is_related_video];
81 $this->sign = $this->generateSign($param,$this->key); 81 $this->sign = $this->generateSign($param,$this->key);
82 $param['sign'] = $this->sign; 82 $param['sign'] = $this->sign;
83 $result = http_post($request_url,json_encode($param,true)); 83 $result = http_post($request_url,json_encode($param,true));