作者 lyh

gx

... ... @@ -2,11 +2,13 @@
namespace App\Http\Logic\Bside\Ai;
use App\Helper\Translate;
use App\Http\Logic\Bside\BaseLogic;
use App\Models\Ai\AiBlog;
use App\Models\Project\AiBlogTask;
use App\Models\Project\Project;
use App\Models\Project\ProjectAiSetting;
use App\Models\RouteMap\RouteMap;
use App\Services\AiBlogService;
class AiBlogLogic extends BaseLogic
... ... @@ -50,6 +52,9 @@ class AiBlogLogic extends BaseLogic
$aiBlogService = new AiBlogService();
$aiBlogService->mch_id = $aiSettingInfo['mch_id'];
$aiBlogService->key = $aiSettingInfo['key'];
if(!empty($this->param['route'])){
$aiBlogService->route = generateRoute(Translate::tran($this->param['route'], 'en'));
}
$result = $aiBlogService->createTask($this->param['keyword'],$this->param['type']);
if($result['status'] == 200){
try {
... ...
... ... @@ -17,7 +17,7 @@ class AiBlogService
public $sign = '';//签名
public $key = 'b3e4c722b821';//默认key
public $webhook = 'https://develop.globalso.com/api/ai_webhook';//回调地址
public $route = '';//回调地址
public $task_id = '';//任务id
/**
... ... @@ -76,7 +76,7 @@ class AiBlogService
'keyword'=>$keyword,
'type'=>$type,
'subtype'=>$subtype,
'url'=>$this->webhook,
'url'=>$this->route,
'template_id'=>$template_id
];
$this->sign = $this->generateSign($param,$this->key);
... ...