AiVideoService.php
1.1 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
48
<?php
/**
* @remark :
* @name :AiVideoService.php
* @author :lyh
* @method :post
* @time :2025/4/29 17:39
*/
namespace App\Services;
use App\Helper\Translate;
use App\Models\Project\ProjectAiSetting;
class AiVideoService
{
public $url = 'https://ai-extend.ai.cc/';
public $mch_id = 1;//默认配置
public $sign = '';//签名
public $key = 'b3e4c722b821';//默认key
public $route = '';//回调地址
public $task_id = '';//任务id
public $author_id = '';//作者id
public function __construct($project_id = 0)
{
if($project_id){
$projectAiSettingModel = new ProjectAiSetting();
$aiSettingInfo = $projectAiSettingModel->read(['project_id'=>$project_id]);
$this->mch_id = $aiSettingInfo['mch_id'];
$this->key = $aiSettingInfo['key'];
}
}
/**
* @remark :设置路由
* @name :setRoute
* @author :lyh
* @method :post
* @time :2025/3/25 9:45
*/
public function setRoute($keyword)
{
$this->route = generateRoute(Translate::tran($keyword, 'en'));
return $this;
}
}