AggregateKeywordController.php
2.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<?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);
}
}