122 lines
2.9 KiB
PHP
122 lines
2.9 KiB
PHP
<?php
|
|
namespace app\adminapi\controller\setting;
|
|
|
|
|
|
use app\adminapi\controller\BaseAdminController;
|
|
use app\adminapi\lists\setting\LanguagePagLists;
|
|
use app\adminapi\logic\setting\LanguagePagLogic;
|
|
use app\adminapi\validate\setting\LanguagePagValidate;
|
|
|
|
|
|
/**
|
|
* 语言包控制器
|
|
* Class LanguagePagController
|
|
* @package app\adminapi\controller\setting
|
|
*/
|
|
class LanguagePagController extends BaseAdminController
|
|
{
|
|
|
|
|
|
/**
|
|
* @notes 获取语言包列表
|
|
* @return \think\response\Json
|
|
* @author BD
|
|
* @date 2024/01/14 13:50
|
|
*/
|
|
public function lists()
|
|
{
|
|
return $this->dataLists(new LanguagePagLists());
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 添加语言包
|
|
* @return \think\response\Json
|
|
* @author BD
|
|
* @date 2024/01/14 13:50
|
|
*/
|
|
public function add()
|
|
{
|
|
$params = (new LanguagePagValidate())->post()->goCheck('add');
|
|
$result = LanguagePagLogic::add($params);
|
|
if (true === $result) {
|
|
return $this->success('添加成功', [], 1, 1);
|
|
}
|
|
return $this->fail(LanguagePagLogic::getError());
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 编辑语言包
|
|
* @return \think\response\Json
|
|
* @author BD
|
|
* @date 2024/01/14 13:50
|
|
*/
|
|
public function edit()
|
|
{
|
|
$params = (new LanguagePagValidate())->post()->goCheck('edit');
|
|
$result = LanguagePagLogic::edit($params);
|
|
if (true === $result) {
|
|
return $this->success('编辑成功', [], 1, 1);
|
|
}
|
|
return $this->fail(LanguagePagLogic::getError());
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 删除语言包
|
|
* @return \think\response\Json
|
|
* @author BD
|
|
* @date 2024/01/14 13:50
|
|
*/
|
|
public function delete()
|
|
{
|
|
$params = (new LanguagePagValidate())->post()->goCheck('delete');
|
|
LanguagePagLogic::delete($params);
|
|
return $this->success('删除成功', [], 1, 1);
|
|
}
|
|
|
|
|
|
/**
|
|
* @notes 获取语言包详情
|
|
* @return \think\response\Json
|
|
* @author BD
|
|
* @date 2024/01/14 13:50
|
|
*/
|
|
public function detail()
|
|
{
|
|
$params = (new LanguagePagValidate())->goCheck('detail');
|
|
$result = LanguagePagLogic::detail($params);
|
|
return $this->data($result);
|
|
}
|
|
|
|
/**
|
|
* @notes 同步语言包
|
|
* @return \think\response\Json
|
|
* @author BD
|
|
* @date 2024/01/14 13:50
|
|
*/
|
|
public function sync()
|
|
{
|
|
$params = $this->request->post();
|
|
LanguagePagLogic::sync($params);
|
|
return $this->success('同步成功', [], 1, 1);
|
|
}
|
|
|
|
/**
|
|
* @notes 翻译语言包
|
|
* @return \think\response\Json
|
|
* @author BD
|
|
* @date 2024/01/14 13:50
|
|
*/
|
|
public function trans()
|
|
{
|
|
$params = $this->request->post();
|
|
$result = LanguagePagLogic::trans($params);
|
|
if (true === $result) {
|
|
return $this->success('翻译成功', [], 1, 1);
|
|
}
|
|
return $this->fail(LanguagePagLogic::getError());
|
|
}
|
|
|
|
} |