SettingFaqController.php
2.5 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
<?php
/**
* @remark :
* @name :SettingFaqController.php
* @author :lyh
* @method :post
* @time :2025/10/29 16:32
*/
namespace App\Http\Controllers\Bside\Setting;
use App\Enums\Common\Code;
use App\Http\Controllers\Bside\BaseController;
use App\Http\Logic\Bside\Setting\SettingFaqLogic;
use App\Models\RouteMap\RouteMap;
use Illuminate\Http\Request;
class SettingFaqController extends BaseController
{
public function __construct(Request $request)
{
parent::__construct($request);
$this->logic = new SettingFaqLogic();
}
/**
* @remark :获取所有路由
* @name :getRouteList
* @author :lyh
* @method :post
* @time :2025/10/30 09:35
*/
public function getRouteList(){
$data = $this->logic->getRouteList();
$this->response('success',Code::SUCCESS,$data);
}
/**
* @remark :faq列表页数据
* @name :lists
* @author :lyh
* @method :post
* @time :2025/10/29 16:38
*/
public function lists()
{
$lists = $this->logic->getFaqLists($this->map,$this->page,$this->row,$this->order);
$this->response('success',Code::SUCCESS,$lists);
}
/**
* @remark :获取详情
* @name :getInfo
* @author :lyh
* @method :post
* @time :2025/10/30 09:28
*/
public function getInfo()
{
$this->request->validate([
'id'=>'required',
],[
'id.required' => 'ID不能为空',
]);
$data = $this->logic->getFaqInfo();
$this->response('success',Code::SUCCESS,$data);
}
/**
* @remark :保存faq数据
* @name :saveFaq
* @author :lyh
* @method :post
* @time :2025/10/29 17:21
*/
public function saveFaq()
{
$this->request->validate([
'route'=>'required',
],[
'route.required' => '路由不能为空',
]);
$data = $this->logic->saveFaq();
$this->response('success',Code::SUCCESS,$data);
}
/**
* @remark :删除对应数据
* @name :deleteFaq
* @author :lyh
* @method :post
* @time :2025/10/29 17:23
*/
public function deleteFaq(){
$this->request->validate([
'id'=>'required|array',
],[
'id.required' => 'ID不能为空',
'id.array' => 'ID为数组',
]);
$data = $this->logic->deleteFaq();
$this->response('success',Code::SUCCESS,$data);
}
}