GoogleKeywordInsightController.php 1.2 KB
<?php
/**
 * @remark :
 * @name   :GoogleKeywordInsightController.php
 * @author :lyh
 * @method :post
 * @time   :2025/3/25 14:23
 */

namespace App\Http\Controllers\Bside\GoogleKeyword;

use App\Enums\Common\Code;
use App\Http\Controllers\Bside\BaseController;
use App\Http\Logic\Bside\GoogleKeywordInsight\GoogleKeywordInsightLogic;
use App\Models\GoogleKeywordInsight\GoogleKeywordInsightDetail;

/**
 * @remark :谷歌洞察数据
 * @name   :GoogleKeywordInsightController
 * @author :lyh
 * @method :post
 * @time   :2025/3/25 14:24
 */
class GoogleKeywordInsightController extends BaseController
{
    /**
     * @remark :保存数据
     * @name   :saveKeywordInsight
     * @author :lyh
     * @method :post
     * @time   :2025/3/25 14:30
     */
    public function getKeywordInsight(GoogleKeywordInsightLogic $logic){
        $this->request->validate([
            'keyword' => 'required'
        ],[
            'keyword.required' => '关键词不能为空',
        ]);
        $logic->getGoogleInsight();
        $detailModel = new GoogleKeywordInsightDetail();
        $data = $detailModel->lists(['search'=>$this->param['keyword']],$this->page,$this->row);
        $this->response('success',Code::SUCCESS,$data);
    }
}