作者 zhl

通知后获取数据接口

@@ -432,4 +432,29 @@ class PrivateController extends BaseController @@ -432,4 +432,29 @@ class PrivateController extends BaseController
432 DB::disconnect('custom_mysql'); 432 DB::disconnect('custom_mysql');
433 $this->response('success',Code::SUCCESS,$data); 433 $this->response('success',Code::SUCCESS,$data);
434 } 434 }
  435 +
  436 + /**
  437 + * 获取项目监控关键词
  438 + * @param Request $request
  439 + * @return false|string
  440 + */
  441 + public function getMonitorKeyword(Request $request)
  442 + {
  443 + $domain = trim($request->input('domain'));
  444 + $domain_parse = parse_url($domain);
  445 + $domain = $domain_parse['host'] ?? $domain;
  446 +
  447 + if (empty($domain)) {
  448 + return $this->error('非法参数!');
  449 + }
  450 +
  451 + $project = Project::getProjectByDomain($domain);
  452 + if (empty($project)) {
  453 + return $this->error('未找到当前域名对应的项目!');
  454 + }
  455 +
  456 + $json = file_get_contents(storage_path('data/send_product_tag_keyword/' . $project->id . '.json'));
  457 + $result = json_decode($json, true) ?: [];
  458 + return $this->success($result);
  459 + }
435 } 460 }
@@ -58,6 +58,8 @@ Route::any('get_project_online', [\App\Http\Controllers\Api\PrivateController::c @@ -58,6 +58,8 @@ Route::any('get_project_online', [\App\Http\Controllers\Api\PrivateController::c
58 Route::any('mark_project_ads', [\App\Http\Controllers\Api\PrivateController::class, 'markProjectAds'])->name('api.mark_project_ads'); 58 Route::any('mark_project_ads', [\App\Http\Controllers\Api\PrivateController::class, 'markProjectAds'])->name('api.mark_project_ads');
59 //获取对应产品关键词 59 //获取对应产品关键词
60 Route::any('getProjectKeyword', [\App\Http\Controllers\Api\PrivateController::class, 'getProjectKeyword'])->name('api.getProjectKeyword'); 60 Route::any('getProjectKeyword', [\App\Http\Controllers\Api\PrivateController::class, 'getProjectKeyword'])->name('api.getProjectKeyword');
  61 +// 获取监控关键词 -> send_product_tag_keyword
  62 +Route::any('get_monitor_keyword', [\App\Http\Controllers\Api\PrivateController::class, 'getMonitorKeyword'])->name('api.get_monitor_keyword');
61 //自建站接口转接 63 //自建站接口转接
62 Route::post('selfSiteApi', [\App\Http\Controllers\Api\SelfSiteController::class, 'selfSiteApi']); 64 Route::post('selfSiteApi', [\App\Http\Controllers\Api\SelfSiteController::class, 'selfSiteApi']);
63 Route::post('selfSiteNotify', [\App\Http\Controllers\Api\SelfSiteController::class, 'selfSiteNotify']); 65 Route::post('selfSiteNotify', [\App\Http\Controllers\Api\SelfSiteController::class, 'selfSiteNotify']);