作者 lyh

gx

@@ -2,11 +2,13 @@ @@ -2,11 +2,13 @@
2 2
3 namespace App\Http\Logic\Bside\Ai; 3 namespace App\Http\Logic\Bside\Ai;
4 4
  5 +use App\Helper\Translate;
5 use App\Http\Logic\Bside\BaseLogic; 6 use App\Http\Logic\Bside\BaseLogic;
6 use App\Models\Ai\AiBlog; 7 use App\Models\Ai\AiBlog;
7 use App\Models\Project\AiBlogTask; 8 use App\Models\Project\AiBlogTask;
8 use App\Models\Project\Project; 9 use App\Models\Project\Project;
9 use App\Models\Project\ProjectAiSetting; 10 use App\Models\Project\ProjectAiSetting;
  11 +use App\Models\RouteMap\RouteMap;
10 use App\Services\AiBlogService; 12 use App\Services\AiBlogService;
11 13
12 class AiBlogLogic extends BaseLogic 14 class AiBlogLogic extends BaseLogic
@@ -50,6 +52,9 @@ class AiBlogLogic extends BaseLogic @@ -50,6 +52,9 @@ class AiBlogLogic extends BaseLogic
50 $aiBlogService = new AiBlogService(); 52 $aiBlogService = new AiBlogService();
51 $aiBlogService->mch_id = $aiSettingInfo['mch_id']; 53 $aiBlogService->mch_id = $aiSettingInfo['mch_id'];
52 $aiBlogService->key = $aiSettingInfo['key']; 54 $aiBlogService->key = $aiSettingInfo['key'];
  55 + if(!empty($this->param['route'])){
  56 + $aiBlogService->route = generateRoute(Translate::tran($this->param['route'], 'en'));
  57 + }
53 $result = $aiBlogService->createTask($this->param['keyword'],$this->param['type']); 58 $result = $aiBlogService->createTask($this->param['keyword'],$this->param['type']);
54 if($result['status'] == 200){ 59 if($result['status'] == 200){
55 try { 60 try {
@@ -17,7 +17,7 @@ class AiBlogService @@ -17,7 +17,7 @@ class AiBlogService
17 public $sign = '';//签名 17 public $sign = '';//签名
18 public $key = 'b3e4c722b821';//默认key 18 public $key = 'b3e4c722b821';//默认key
19 19
20 - public $webhook = 'https://develop.globalso.com/api/ai_webhook';//回调地址 20 + public $route = '';//回调地址
21 21
22 public $task_id = '';//任务id 22 public $task_id = '';//任务id
23 /** 23 /**
@@ -76,7 +76,7 @@ class AiBlogService @@ -76,7 +76,7 @@ class AiBlogService
76 'keyword'=>$keyword, 76 'keyword'=>$keyword,
77 'type'=>$type, 77 'type'=>$type,
78 'subtype'=>$subtype, 78 'subtype'=>$subtype,
79 - 'url'=>$this->webhook, 79 + 'url'=>$this->route,
80 'template_id'=>$template_id 80 'template_id'=>$template_id
81 ]; 81 ];
82 $this->sign = $this->generateSign($param,$this->key); 82 $this->sign = $this->generateSign($param,$this->key);