ProjectGscController.php
2.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
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
101
102
<?php
namespace App\Http\Controllers\Aside\Project;
use App\Enums\Common\Code;
use App\Http\Controllers\Aside\BaseController;
use App\Http\Logic\Aside\Project\GscLogic;
use App\Http\Requests\Aside\User\GscRequest;
/**
* @remark :优化gsc账号
* @name :ProjectGscController
* @author :lyh
* @time :2023/6/19 11:25
*/
class ProjectGscController extends BaseController
{
/**
* @remark :gsc账号列表
* @name :lists
* @author :lyh
* @method :post
* @time :2023/6/19 11:25
*/
public function lists(GscLogic $gscLogic){
$lists = $gscLogic->GscLists($this->map,$this->page,$this->row,$this->order);
$this->response('success',Code::SUCCESS,$lists);
}
/**
* @remark :根据gsc账号获取域名
* @name :lists
* @author :lyh
* @method :post
* @time :2023/6/19 10:48
*/
public function domainLists(GscLogic $gscLogic){
$this->request->validate([
'gsc_id'=>'required'
],[
'gsc_id.required' => 'GSC账号ID不能为空'
]);
$lists = $gscLogic->DomainLists($this->map,$this->page,$this->row,$this->order);
$this->response('success',Code::SUCCESS,$lists);
}
/**
* @remark :获取gsc账号详情
* @name :read
* @author :lyh
* @method :post
* @time :2023/6/19 16:55
*/
public function read(GscLogic $gscLogic){
$this->request->validate([
'id'=>'required'
],[
'id.required' => 'GSC账号ID不能为空'
]);
$info = $gscLogic->GscRead();
$this->response('success',Code::SUCCESS,$info);
}
/**
* @remark :添加/编辑gsc账号
* @name :add
* @author :lyh
* @method :post
* @time :2023/6/19 16:28
*/
public function save(GscRequest $gscRequest,GscLogic $gscLogic){
if(isset($this->param['id'])){
$gscRequest->validate([
'id'=>'required'
],[
'id.required' => 'GSC账号ID不能为空'
]);
}
$gscRequest->validated();
$gscLogic->GscSave();
$this->response('success');
}
/**
* @remark :逻辑删除gsc账号
* @name :del
* @author :lyh
* @method :post
* @time :2023/6/19 16:30
*/
public function del(GscLogic $gscLogic){
$this->request->validate([
'id'=>'required'
],[
'id.required' => 'GSC账号ID不能为空'
]);
$gscLogic->GscDel();
$this->response('success');
}
}