作者 lyh

gx

@@ -14,7 +14,7 @@ use App\Models\Domain\DomainInfo; @@ -14,7 +14,7 @@ use App\Models\Domain\DomainInfo;
14 use App\Models\GoogleSearch\GoogleSearch; 14 use App\Models\GoogleSearch\GoogleSearch;
15 use App\Models\GoogleSearch\GoogleSearchDetail; 15 use App\Models\GoogleSearch\GoogleSearchDetail;
16 use App\Models\Project\Project; 16 use App\Models\Project\Project;
17 -use App\Services\GoogleSearchService; 17 +use App\Services\RapIdApIService;
18 use App\Services\ProjectServer; 18 use App\Services\ProjectServer;
19 use Illuminate\Console\Command; 19 use Illuminate\Console\Command;
20 use Illuminate\Support\Facades\DB; 20 use Illuminate\Support\Facades\DB;
@@ -48,7 +48,7 @@ class GoogleSearchKeyword extends Command @@ -48,7 +48,7 @@ class GoogleSearchKeyword extends Command
48 48
49 public function __construct() 49 public function __construct()
50 { 50 {
51 - $this->googleService = new GoogleSearchService(); 51 + $this->googleService = new RapIdApIService();
52 $this->searchModel = new GoogleSearch(); 52 $this->searchModel = new GoogleSearch();
53 $this->detailModel = new GoogleSearchDetail(); 53 $this->detailModel = new GoogleSearchDetail();
54 parent::__construct(); 54 parent::__construct();
@@ -16,7 +16,7 @@ use App\Http\Controllers\Bside\BaseController; @@ -16,7 +16,7 @@ use App\Http\Controllers\Bside\BaseController;
16 use App\Models\Com\NoticeLog; 16 use App\Models\Com\NoticeLog;
17 use App\Models\GoogleSearch\GoogleSearch; 17 use App\Models\GoogleSearch\GoogleSearch;
18 use App\Models\GoogleSearch\GoogleSearchDetail; 18 use App\Models\GoogleSearch\GoogleSearchDetail;
19 -use App\Services\GoogleSearchService; 19 +use App\Services\RapIdApIService;
20 20
21 class GoogleSearchController extends BaseController 21 class GoogleSearchController extends BaseController
22 { 22 {
@@ -28,7 +28,7 @@ use App\Models\Project\Project; @@ -28,7 +28,7 @@ use App\Models\Project\Project;
28 use App\Models\Project\ProjectAiSetting; 28 use App\Models\Project\ProjectAiSetting;
29 use App\Models\RouteMap\RouteMap; 29 use App\Models\RouteMap\RouteMap;
30 use App\Services\AiBlogService; 30 use App\Services\AiBlogService;
31 -use App\Services\GoogleSearchService; 31 +use App\Services\RapIdApIService;
32 use App\Services\ProjectServer; 32 use App\Services\ProjectServer;
33 use Illuminate\Support\Facades\DB; 33 use Illuminate\Support\Facades\DB;
34 34
@@ -13,7 +13,7 @@ use App\Helper\Translate; @@ -13,7 +13,7 @@ use App\Helper\Translate;
13 use App\Http\Logic\Bside\BaseLogic; 13 use App\Http\Logic\Bside\BaseLogic;
14 use App\Models\GoogleKeywordInsight\GoogleKeywordInsight; 14 use App\Models\GoogleKeywordInsight\GoogleKeywordInsight;
15 use App\Models\GoogleKeywordInsight\GoogleKeywordInsightDetail; 15 use App\Models\GoogleKeywordInsight\GoogleKeywordInsightDetail;
16 -use App\Services\GoogleSearchService; 16 +use App\Services\RapIdApIService;
17 use Illuminate\Support\Facades\DB; 17 use Illuminate\Support\Facades\DB;
18 18
19 class GoogleKeywordInsightLogic extends BaseLogic 19 class GoogleKeywordInsightLogic extends BaseLogic
@@ -37,7 +37,7 @@ class GoogleKeywordInsightLogic extends BaseLogic @@ -37,7 +37,7 @@ class GoogleKeywordInsightLogic extends BaseLogic
37 public function getGoogleInsight(){ 37 public function getGoogleInsight(){
38 $data = $this->model->read(['search'=>$this->param['keyword']],['id']); 38 $data = $this->model->read(['search'=>$this->param['keyword']],['id']);
39 if($data === false){ 39 if($data === false){
40 - $this->service = new GoogleSearchService(); 40 + $this->service = new RapIdApIService();
41 $data = $this->service->requestUrl($this->param['keyword']); 41 $data = $this->service->requestUrl($this->param['keyword']);
42 if(!empty($data)){ 42 if(!empty($data)){
43 DB::beginTransaction(); 43 DB::beginTransaction();
@@ -64,7 +64,7 @@ class GoogleKeywordInsightLogic extends BaseLogic @@ -64,7 +64,7 @@ class GoogleKeywordInsightLogic extends BaseLogic
64 * @time :2025/3/25 14:36 64 * @time :2025/3/25 14:36
65 */ 65 */
66 public function getGoogleInsightDetail(){ 66 public function getGoogleInsightDetail(){
67 - $this->service = new GoogleSearchService(); 67 + $this->service = new RapIdApIService();
68 $data = $this->service->requestUrl($this->param['keyword']); 68 $data = $this->service->requestUrl($this->param['keyword']);
69 if(!empty($data)){ 69 if(!empty($data)){
70 DB::beginTransaction(); 70 DB::beginTransaction();
1 <?php 1 <?php
2 /** 2 /**
3 * @remark : 3 * @remark :
4 - * @name :GoogleSearchService.php 4 + * @name :RapIdApIService.php
5 * @author :lyh 5 * @author :lyh
6 * @method :post 6 * @method :post
7 * @time :2025/3/25 11:36 7 * @time :2025/3/25 11:36
@@ -13,15 +13,17 @@ use App\Helper\Country; @@ -13,15 +13,17 @@ use App\Helper\Country;
13 13
14 /** 14 /**
15 * @remark :google关键字扩展 15 * @remark :google关键字扩展
16 - * @name :GoogleSearchService 16 + * @name :RapIdApIService
17 * @author :lyh 17 * @author :lyh
18 * @method :post 18 * @method :post
19 * @time :2025/3/25 11:38 19 * @time :2025/3/25 11:38
20 */ 20 */
21 -class GoogleSearchService 21 +class RapIdApIService
22 { 22 {
23 public $url = ""; 23 public $url = "";
24 24
  25 + public $key = '3eba1ba999msh3a7c11101a7e298p19924bjsn5089487f7c37';
  26 +
25 /** 27 /**
26 * @remark :扩展关键词请求数据 28 * @remark :扩展关键词请求数据
27 * @name :requestUrl 29 * @name :requestUrl
@@ -67,7 +69,7 @@ class GoogleSearchService @@ -67,7 +69,7 @@ class GoogleSearchService
67 CURLOPT_CUSTOMREQUEST => "GET", 69 CURLOPT_CUSTOMREQUEST => "GET",
68 CURLOPT_HTTPHEADER => [ 70 CURLOPT_HTTPHEADER => [
69 "x-rapidapi-host: google-keyword-insight1.p.rapidapi.com", 71 "x-rapidapi-host: google-keyword-insight1.p.rapidapi.com",
70 - "x-rapidapi-key: d246239565mshc29088b58ff484dp17c0bdjsn2d28d03622c7" 72 + "x-rapidapi-key: $this->key"
71 ], 73 ],
72 ]); 74 ]);
73 $response = curl_exec($curl); 75 $response = curl_exec($curl);