AggregateKeywordAffixController.php
1.6 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
<?php
/**
* @remark :
* @name :AggregateKeywordAffixController.php
* @author :lyh
* @method :post
* @time :2025/5/27 14:20
*/
namespace App\Http\Controllers\Aside\Project;
use App\Enums\Common\Code;
use App\Http\Controllers\Aside\BaseController;
use App\Http\Logic\Aside\Project\AggregateKeywordAffixLogic;
use Illuminate\Http\Request;
class AggregateKeywordAffixController extends BaseController
{
public function __construct(Request $request)
{
parent::__construct($request);
$this->logic = new AggregateKeywordAffixLogic();
}
/**
* @remark :获取当前项目关键字前后缀
* @name :getAffix
* @author :lyh
* @method :post
* @time :2025/5/27 14:23
*/
public function getAffix(){
$this->request->validate([
'project_id'=>'required',
],[
'project_id.required' => 'project_id不能为空',
]);
$data = $this->logic->getAffix();
$this->response('success',Code::SUCCESS,$data);
}
/**
* @remark :保存关键字前后缀
* @name :save
* @author :lyh
* @method :post
* @time :2025/5/27 14:23
*/
public function saveAffix(){
$this->request->validate([
'project_id'=>'required',
'prefix'=>'required',
'suffix'=>'required',
],[
'project_id.required' => 'project_id不能为空',
'prefix.required' => '前缀不能为空',
'suffix.required' => '后缀不能为空',
]);
$data = $this->logic->saveAffix();
$this->response('success',Code::SUCCESS,$data);
}
}