正在显示
5 个修改的文件
包含
21 行增加
和
6 行删除
| @@ -12,7 +12,6 @@ namespace App\Console\Commands\Ai; | @@ -12,7 +12,6 @@ namespace App\Console\Commands\Ai; | ||
| 12 | use App\Models\Product\Product; | 12 | use App\Models\Product\Product; |
| 13 | use App\Models\Project\DeployOptimize; | 13 | use App\Models\Project\DeployOptimize; |
| 14 | use App\Models\Project\Project; | 14 | use App\Models\Project\Project; |
| 15 | -use App\Models\WebSetting\WebSetting; | ||
| 16 | use App\Services\ProjectServer; | 15 | use App\Services\ProjectServer; |
| 17 | use Illuminate\Console\Command; | 16 | use Illuminate\Console\Command; |
| 18 | use Illuminate\Support\Facades\DB; | 17 | use Illuminate\Support\Facades\DB; |
| @@ -63,11 +63,12 @@ class AiVideoLogic extends BaseLogic | @@ -63,11 +63,12 @@ class AiVideoLogic extends BaseLogic | ||
| 63 | * @detail :status=1/待执行 | 63 | * @detail :status=1/待执行 |
| 64 | */ | 64 | */ |
| 65 | public function sendTask(){ | 65 | public function sendTask(){ |
| 66 | + $aiVideoTaskModel = new AiVideoTask(); | ||
| 66 | $aiVideoService = new AiVideoService($this->user['project_id']); | 67 | $aiVideoService = new AiVideoService($this->user['project_id']); |
| 67 | - $result = $aiVideoService->createTask($this->param['title'],$this->param['description'],$this->param['images'],$this->param['anchor'] ?? []); | 68 | + $storage = $aiVideoTaskModel->videoSetting()[$this->user['video_setting'] ?? 1]; |
| 69 | + $result = $aiVideoService->createTask($this->param['title'],$this->param['description'],$this->param['images'],$this->param['anchor'] ?? [],$storage); | ||
| 68 | if($result['status'] == 200){ | 70 | if($result['status'] == 200){ |
| 69 | - $aiVideoTaskModel = new AiVideoTask(); | ||
| 70 | - $aiVideoTaskModel->addReturnId(['task_id'=>$result['data']['task_id'],'project_id'=>$this->user['project_id']]); | 71 | + $aiVideoTaskModel->addReturnId(['task_id'=>$result['data']['task_id'],'project_id'=>$this->user['project_id'],'storage'=>$storage]); |
| 71 | $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)]); | 72 | $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)]); |
| 72 | return $this->success(['id'=>$id]); | 73 | return $this->success(['id'=>$id]); |
| 73 | } | 74 | } |
| @@ -277,6 +277,7 @@ class UserLoginLogic | @@ -277,6 +277,7 @@ class UserLoginLogic | ||
| 277 | $info['main_lang_id'] = $project['main_lang_id']; | 277 | $info['main_lang_id'] = $project['main_lang_id']; |
| 278 | $info['is_ai_blog'] = $project['is_ai_blog'] ?? 0; | 278 | $info['is_ai_blog'] = $project['is_ai_blog'] ?? 0; |
| 279 | $info['is_ai_video'] = $project['is_ai_video'] ?? 0; | 279 | $info['is_ai_video'] = $project['is_ai_video'] ?? 0; |
| 280 | + $info['video_setting'] = $project['deploy_optimize']['video_setting'] ?? 1; | ||
| 280 | $info['image_max'] = $project['image_max']; | 281 | $info['image_max'] = $project['image_max']; |
| 281 | $info['is_del_inquiry'] = $project['is_del_inquiry'] ?? 0; | 282 | $info['is_del_inquiry'] = $project['is_del_inquiry'] ?? 0; |
| 282 | $info['uptime_type'] = $this->getHistory($project); | 283 | $info['uptime_type'] = $this->getHistory($project); |
| @@ -20,4 +20,18 @@ class AiVideoTask extends Base | @@ -20,4 +20,18 @@ class AiVideoTask extends Base | ||
| 20 | */ | 20 | */ |
| 21 | const STATUS_RUNNING = 1; | 21 | const STATUS_RUNNING = 1; |
| 22 | const STATUS_FINISH = 2; | 22 | const STATUS_FINISH = 2; |
| 23 | + | ||
| 24 | + /** | ||
| 25 | + * @remark :视频设置 | ||
| 26 | + * @name :videoSetting | ||
| 27 | + * @author :lyh | ||
| 28 | + * @method :post | ||
| 29 | + * @time :2025/8/1 17:17 | ||
| 30 | + */ | ||
| 31 | + public function videoSetting(){ | ||
| 32 | + return [ | ||
| 33 | + 1 => 'CDN', | ||
| 34 | + 2 => 'YOUTUBE' | ||
| 35 | + ]; | ||
| 36 | + } | ||
| 23 | } | 37 | } |
| @@ -55,9 +55,9 @@ class AiVideoService | @@ -55,9 +55,9 @@ class AiVideoService | ||
| 55 | * @method :post | 55 | * @method :post |
| 56 | * @time :2025/4/29 17:59 | 56 | * @time :2025/4/29 17:59 |
| 57 | */ | 57 | */ |
| 58 | - public function createTask($title,$description,$images = [],$anchor = []){ | 58 | + public function createTask($title,$description,$images = [],$anchor = [],$storage = 'CDN'){ |
| 59 | $request_url = $this->url.'api/video/create'; | 59 | $request_url = $this->url.'api/video/create'; |
| 60 | - $param = ['title'=>$title, 'description'=>$description, 'images'=>$images,'anchor'=>$anchor]; | 60 | + $param = ['title'=>$title, 'description'=>$description, 'images'=>$images,'anchor'=>$anchor,'storage'=>$storage]; |
| 61 | $param['mch_id'] = $this->mch_id; | 61 | $param['mch_id'] = $this->mch_id; |
| 62 | $this->sign = $this->generateSign($param,$this->key); | 62 | $this->sign = $this->generateSign($param,$this->key); |
| 63 | $param['sign'] = $this->sign; | 63 | $param['sign'] = $this->sign; |
-
请 注册 或 登录 后发表评论