72 lines
1.5 KiB
PHP
72 lines
1.5 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Controller\Admin;
|
|
|
|
use App\Controller\AbstractController;
|
|
use App\Request\Admin\AuthRequest;
|
|
use App\Service\Admin\User\RoleMenuService;
|
|
use App\Service\Admin\User\RoleService;
|
|
use Hyperf\HttpServer\Annotation\Controller;
|
|
use Hyperf\HttpServer\Annotation\RequestMapping;
|
|
use Hyperf\HttpServer\Contract\RequestInterface;
|
|
use Hyperf\HttpServer\Contract\ResponseInterface;
|
|
use Hyperf\Validation\Annotation\Scene;
|
|
|
|
#[Controller(prefix: "admin/auth")]
|
|
class AuthController extends AbstractController
|
|
{
|
|
public function menu_add(AuthRequest $request)
|
|
{
|
|
return (new RoleMenuService)->add();
|
|
}
|
|
|
|
public function menu_edit()
|
|
{
|
|
return (new RoleMenuService)->edit();
|
|
}
|
|
|
|
public function menu_del()
|
|
{
|
|
return (new RoleMenuService)->del();
|
|
}
|
|
|
|
public function menu_list()
|
|
{
|
|
return (new RoleMenuService)->handle();
|
|
}
|
|
|
|
public function mean()
|
|
{
|
|
return (new RoleMenuService)->details();
|
|
}
|
|
|
|
public function role_add(AuthRequest $request)
|
|
{
|
|
return (new RoleService)->add();
|
|
}
|
|
|
|
public function role_edit()
|
|
{
|
|
return (new RoleService)->edit();
|
|
}
|
|
|
|
public function role_status()
|
|
{
|
|
return (new RoleService)->changeStatus();
|
|
}
|
|
|
|
public function role_list()
|
|
{
|
|
return (new RoleService)->handle();
|
|
}
|
|
|
|
#[RequestMapping(path: "role", methods: "GET")]
|
|
#[Scene(scene: "role_info")]
|
|
public function role(AuthRequest $request)
|
|
{
|
|
return (new RoleService)->details();
|
|
}
|
|
}
|