ProjectCountryController.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
<?php
namespace App\Http\Controllers\Bside\Setting;
use App\Enums\Common\Code;
use App\Http\Controllers\Bside\BaseController;
use App\Http\Logic\Aside\Domain\DomainInfoLogic;
use App\Http\Logic\Bside\Setting\ProjectCountryLogic;
/**
* @name:项目配置多语言设置
*/
class ProjectCountryController extends BaseController
{
/**
* @name :(当前项目的多语言列表)lists
* @author :lyh
* @method :post
* @time :2023/4/28 14:49
*/
public function info(ProjectCountryLogic $projectCountryLogic){
$lists = $projectCountryLogic->country_info();
$this->response('success',Code::SUCCESS,$lists);
}
/**
* @name :(更新当前项目多语言设置)edit
* @author :lyh
* @method :post
* @time :2023/4/28 17:53
*/
public function save(ProjectCountryLogic $projectCountryLogic){
$projectCountryLogic->country_save();
$this->response('success');
}
/**
* 设置语种自定义跳转链接
* @param DomainInfoLogic $domainInfoLogic
* @author Akun
* @date 2024/03/05 9:47
*/
public function custom_save(DomainInfoLogic $domainInfoLogic){
$this->request->validate([
'language_id'=>'required',
'is_create'=>'required'
],[
'language_id.required' => 'language_id不能为空',
'is_create.required' => 'is_create不能为空'
]);
if(isset($this->param['custom_domain']) && $this->param['custom_domain']){
$domainInfoLogic->country_custom($this->user['project_id']);
}else{
$projectCountryLogic = new ProjectCountryLogic();
$projectCountryLogic->country_custom_del();
}
$this->response('success');
}
/**
* 清除语种自定义跳转链接
* @param ProjectCountryLogic $projectCountryLogic
* @author Akun
* @date 2024/03/05 10:20
*/
public function custom_del(ProjectCountryLogic $projectCountryLogic){
$this->request->validate([
'language_id'=>'required'
],[
'language_id.required' => 'language_id不能为空'
]);
$projectCountryLogic->country_custom_del();
$this->response('success');
}
/**
* 获取语种自定义跳转链接详情
* @param ProjectCountryLogic $projectCountryLogic
* @author Akun
* @date 2024/03/06 14:37
*/
public function custom_info(ProjectCountryLogic $projectCountryLogic){
$this->request->validate([
'language_id'=>'required'
],[
'language_id.required' => 'language_id不能为空'
]);
$info = $projectCountryLogic->country_custom_info();
$this->response('success',Code::SUCCESS,$info);
}
}