|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* @remark :
|
|
|
|
* @name :AggregateKeywordController.php
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2025/3/17 16:03
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace App\Http\Controllers\Aside\Project;
|
|
|
|
|
|
|
|
use App\Enums\Common\Code;
|
|
|
|
use App\Http\Controllers\Aside\BaseController;
|
|
|
|
use App\Http\Logic\Aside\Project\AggregateKeywordLogic;
|
|
|
|
use App\Models\Project\AggregateKeyword;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :聚合页关键词设置
|
|
|
|
* @name :AggregateKeywordController
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2025/3/17 16:04
|
|
|
|
*/
|
|
|
|
class AggregateKeywordController extends BaseController
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @remark :根据项目获取项目对应的聚合页关键词
|
|
|
|
* @name :lists
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2025/3/17 16:04
|
|
|
|
*/
|
|
|
|
public function lists(AggregateKeyword $aggregateKeyword){
|
|
|
|
$this->request->validate([
|
|
|
|
'project_id'=>'required',
|
|
|
|
],[
|
|
|
|
'project_id.required' => 'project_id不能为空',
|
|
|
|
]);
|
|
|
|
$lists = $aggregateKeyword->list($this->map);
|
|
|
|
$this->response('success',Code::SUCCESS,$lists);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :获取数据详情
|
|
|
|
* @name :info
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2025/3/17 16:18
|
|
|
|
*/
|
|
|
|
public function info(AggregateKeyword $aggregateKeyword){
|
|
|
|
$this->request->validate([
|
|
|
|
'id'=>'required',
|
|
|
|
],[
|
|
|
|
'id.required' => '主键不能为空',
|
|
|
|
]);
|
|
|
|
$data = $aggregateKeyword->read($this->map);
|
|
|
|
$this->response('success',Code::SUCCESS,$data);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :保存数据
|
|
|
|
* @name :save
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2025/3/17 16:05
|
|
|
|
* @param :created_at->创建使劲; operator->创建人; keywords->关键字一行一个; project_id->项目id
|
|
|
|
*/
|
|
|
|
public function save(AggregateKeywordLogic $logic){
|
|
|
|
$this->request->validate([
|
|
|
|
'project_id'=>'required',
|
|
|
|
'created_at'=>'required',
|
|
|
|
'operator'=>'required',
|
|
|
|
'keywords'=>'required',
|
|
|
|
],[
|
|
|
|
'project_id.required' => 'project_id不能为空',
|
|
|
|
'created_at.required' => 'created_at不能为空',
|
|
|
|
'operator.required' => 'operator不能为空',
|
|
|
|
'keywords.required' => 'keywords不能为空',
|
|
|
|
]);
|
|
|
|
$data = $logic->saveKeyword();
|
|
|
|
$this->response('success',Code::SUCCESS,$data);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :删除数据
|
|
|
|
* @name :del
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2025/3/17 16:05
|
|
|
|
*/
|
|
|
|
public function del(AggregateKeyword $aggregateKeyword){
|
|
|
|
$this->request->validate([
|
|
|
|
'id'=>'required',
|
|
|
|
],[
|
|
|
|
'id.required' => '主键不能为空',
|
|
|
|
]);
|
|
|
|
$data = $aggregateKeyword->del($this->map);
|
|
|
|
$this->response('success',Code::SUCCESS,$data);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|