WebSettingController.php
1.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
<?php
namespace App\Http\Controllers\Bside\Setting;
use App\Enums\Common\Code;
use App\Http\Controllers\Bside\BaseController;
use App\Http\Logic\Bside\Setting\WebSettingLogic;
use App\Models\Com\UpdateNotify;
use Illuminate\Http\Request;
/**
* @name:项目首页设置
*/
class WebSettingController extends BaseController
{
/**
* @name :首页设置
* @return void
* @author :liyuhang
* @method
*/
public function lists(WebSettingLogic $webSettingLogic){
$info = $webSettingLogic->setting_read();
$this->response('success',Code::SUCCESS,$info);
}
/**
* @name :添加数据add
* @author :lyh
* @method :post
* @time :2023/4/28 15:17
*/
public function save(WebSettingLogic $webSettingLogic){
$webSettingLogic->setting_save();
$this->response('success');
}
/**
* 更新通知C端
* @param Request $request
* @param WebSettingLogic $webSettingLogic
*/
public function sendNotify(WebSettingLogic $webSettingLogic){
$type = $this->request->input('type', UpdateNotify::TYPE_MASTER);
if (FALSE == in_array($type, [UpdateNotify::TYPE_MASTER, UpdateNotify::TYPE_MINOR])){
$this->response('非法参数!', Code::USER_ERROR);
}
$page = $this->request->input('page', UpdateNotify::PAGE_ALL);
if (FALSE == in_array($type, [UpdateNotify::PAGE_ALL, UpdateNotify::PAGE_SINGLE])){
$this->response('非法参数!', Code::USER_ERROR);
}
$list = $webSettingLogic->sendNotifyMessage($type,$page);
if(!empty($list)){
$this->response('当前页面正在生成了,请完成后再点击',Code::USER_ERROR,$list);
}
$this->response('success');
}
}