MenuSpecialController.php
2.7 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
103
104
105
106
107
<?php
/**
* @remark :
* @name :MenuSpecialController.php
* @author :lyh
* @method :post
* @time :2023/8/7 11:51
*/
namespace App\Http\Controllers\Aside\Manage;
use App\Enums\Common\Code;
use App\Http\Controllers\Aside\BaseController;
use App\Http\Logic\Aside\Manage\MenuSpecialLogic;
use App\Models\Manage\MenuSpecial;
/**
* @remark :特殊模块设置
* @name :MenuSpecialController
* @author :lyh
* @method :post
* @time :2023/8/7 11:51
*/
class MenuSpecialController extends BaseController
{
/**
* @remark :特殊模块列表
* @name :lists
* @author :lyh
* @method :post
* @time :2023/8/7 11:52
*/
public function lists(MenuSpecial $menuSpecial){
if(isset($this->map['remark']) && !empty($this->map['remark'])){
$this->map['remark'] = ['like','%'.$this->map['remark'].'%'];
}
$lists = $menuSpecial->lists($this->map,$this->page,$this->row,$this->order);
$this->response('success',Code::SUCCESS,$lists);
}
/**
* @remark :详情
* @name :info
* @author :lyh
* @method :post
* @time :2023/8/7 14:31
*/
public function info(MenuSpecialLogic $logic){
$this->request->validate([
'id'=>'required'
],[
'id.required' => 'ID不能为空'
]);
$info = $logic->specialInfo();
$this->response('success',Code::SUCCESS,$info);
}
/**
* @remark :添加时获取用户列表
* @name :managerList
* @author :lyh
* @method :post
* @time :2023/8/7 14:31
*/
public function getManagerList(MenuSpecialLogic $logic){
$list = $logic->managerList($this->map);
$this->response('success',Code::SUCCESS,$list);
}
/**
* @remark :保存特殊模块
* @name :save
* @author :lyh
* @method :post
* @time :2023/8/7 11:54
*/
public function save(MenuSpecialLogic $logic){
$this->request->validate([
'name'=>'required',
'user_list'=>'required',
'remark'=>'required'
],[
'name.required' => 'name不能为空',
'user_list.required' => 'user_list不能为空',
'remark.required' => 'remark不能为空'
]);
$logic->specialSave();
$this->response('success');
}
/**
* @remark :删除特殊模块
* @name :del
* @author :lyh
* @method :post
* @time :2023/8/7 11:54
*/
public function del(MenuSpecialLogic $logic){
$this->request->validate([
'id'=>'required'
],[
'id.required' => 'ID不能为空'
]);
$logic->specialDel();
$this->response('success');
}
}