作者 lyh

gxapi接口

... ... @@ -374,4 +374,31 @@ class PrivateController extends BaseController
$optimize->save();
return $this->success();
}
/**
* @remark :根据项目域名获取产品关键字
* @name :getProjectKeyword
* @author :lyh
* @method :post
* @time :2025/2/7 17:26
*/
public function getProjectKeyword(){
$this->request->validate([
'domain' => 'required',
], [
'domain.required' => '域名不能为空',
]);
$parsedUrl = parse_url($this->map['domain']);
$this->map['domain'] = $parsedUrl['host'] ?? $this->map['domain'];
$domainModel = new DomainInfo();
$info = $domainModel->read(['domain'=>$this->param['domain']]);
if(empty($info)){
$this->response('当前域名不存在',Code::SYSTEM_ERROR);
}
ProjectServer::useProject($info['project_id']);
$productKeywordModel = new Keyword();
$list = $productKeywordModel::orderByRaw('LENGTH(title) ASC')->limit(50)->get();
DB::disconnect('custom_mysql');
$this->response('success',Code::SUCCESS,$list);
}
}
... ...
... ... @@ -56,7 +56,8 @@ Route::any('get_project_product', [\App\Http\Controllers\Api\PrivateController::
Route::any('get_project_online', [\App\Http\Controllers\Api\PrivateController::class, 'getProjectOnline'])->name('api.get_project_online');
// 将项目标记为广告状态
Route::any('mark_project_ads', [\App\Http\Controllers\Api\PrivateController::class, 'markProjectAds'])->name('api.mark_project_ads');
//获取对应产品关键词
Route::any('getProjectKeyword', [\App\Http\Controllers\Api\PrivateController::class, 'getProjectKeyword'])->name('api.getProjectKeyword');
//自建站接口转接
Route::post('selfSiteApi', [\App\Http\Controllers\Api\SelfSiteController::class, 'selfSiteApi']);
Route::post('selfSiteNotify', [\App\Http\Controllers\Api\SelfSiteController::class, 'selfSiteNotify']);
... ...