56 lines
1.2 KiB
PHP
56 lines
1.2 KiB
PHP
<?php
|
|
namespace app\controller;
|
|
|
|
use app\service\RoleService;
|
|
use app\util\Result;
|
|
use support\Request;
|
|
|
|
class RoleController
|
|
{
|
|
/**
|
|
* @Inject
|
|
* @var RoleService
|
|
*/
|
|
private $roleService;
|
|
/**
|
|
* @Inject
|
|
* @var Result
|
|
*/
|
|
private $result;
|
|
|
|
/**
|
|
* User: 高军
|
|
* Date: 2024/5/8
|
|
* QQ: 2926804347
|
|
* @param Request $request
|
|
* @return \support\Response
|
|
* Notes:
|
|
*/
|
|
public function list(Request $request)
|
|
{
|
|
$info = $this->roleService->allList();
|
|
if ($info['result']) return json(retData($this->result::SUCCESS, $info['msg'], $info['data']));
|
|
return json(retData($this->result::ERROR, $info['msg']));
|
|
}
|
|
|
|
/**
|
|
* User: 高军
|
|
* Date: 2024/5/8
|
|
* QQ: 2926804347
|
|
* @param array $param
|
|
* @return array
|
|
* Notes:
|
|
*/
|
|
public function getList(array $param):array
|
|
{
|
|
|
|
}
|
|
|
|
public function save(Request $request)
|
|
{
|
|
$param = $request->post();
|
|
$info = $this->roleService->save($param);
|
|
if ($info['result']) return json(retData($this->result::SUCCESS, $info['msg'], $info['data']));
|
|
return json(retData($this->result::ERROR, $info['msg']));
|
|
}
|
|
} |