登录、模板操作
This commit is contained in:
18
app/template/api/TemplateController.php
Executable file
18
app/template/api/TemplateController.php
Executable file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Api\CodeGeneration;
|
||||
|
||||
use App\BaseApp\BaseController;
|
||||
use App\Service\CodeGeneration\upperCamelCaseService;
|
||||
|
||||
class upperCamelCaseController extends BaseController
|
||||
{
|
||||
//
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->insertField = ['temInsertField'];
|
||||
$this->updateField = ['temUpdateField'];
|
||||
$this->service = upperCamelCaseService::getInstance();
|
||||
}
|
||||
}
|
||||
17
app/template/api/TemplateModel.php
Normal file
17
app/template/api/TemplateModel.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\BaseApp\BaseModel;
|
||||
|
||||
class upperCamelCaseModel extends BaseModel
|
||||
{
|
||||
|
||||
protected $table = 'underLineCase';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $guarded = [];
|
||||
}
|
||||
87
app/template/api/TemplateService.php
Normal file
87
app/template/api/TemplateService.php
Normal file
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
|
||||
namespace App\Service\CodeGeneration;
|
||||
|
||||
use App\BaseApp\BaseService;
|
||||
use App\Models\upperCamelCaseModel;
|
||||
use Exception;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
|
||||
class upperCamelCaseService extends BaseService
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->selectField = ['tmpSelectField'];
|
||||
$this->queryField = ['tmpSearchField'];
|
||||
$this->model = upperCamelCaseModel::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取模板名称列表
|
||||
* @return array
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function list(): array
|
||||
{
|
||||
return $this->getPageList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取模板名称详情
|
||||
* @param $id
|
||||
* @return mixed
|
||||
* @throws Exception
|
||||
*/
|
||||
public function detail($id)
|
||||
{
|
||||
return $this->getDetail($id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 模板名称下拉列表
|
||||
* @return mixed
|
||||
*/
|
||||
public function option()
|
||||
{
|
||||
$this->optionField = ['id', 'name'];
|
||||
return $this->getOption();
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建模板名称
|
||||
* @param $params
|
||||
* @return mixed
|
||||
* @throws Exception
|
||||
*/
|
||||
public function create($params): mixed
|
||||
{
|
||||
return $this->insert($params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑模板名称
|
||||
* @param $id
|
||||
* @param $params
|
||||
* @return mixed
|
||||
* @throws Exception
|
||||
*/
|
||||
public function update($id, $params): mixed
|
||||
{
|
||||
return $this->save($id, $params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除模板名称
|
||||
* @param $ids
|
||||
* @return mixed|true
|
||||
* @throws Exception
|
||||
*/
|
||||
public function delete($ids): mixed
|
||||
{
|
||||
return $this->del($ids);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user