feat : user
This commit is contained in:
56
app/Controller/Admin/EmployeeController.php
Normal file
56
app/Controller/Admin/EmployeeController.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Controller\Admin;
|
||||
|
||||
use App\Middleware\Admin\JwtAuthMiddleware;
|
||||
use App\Request\Admin\EmployeeRequest;
|
||||
use App\Service\Admin\EmployeeService;
|
||||
use Hyperf\HttpServer\Annotation\Controller;
|
||||
use Hyperf\HttpServer\Annotation\Middlewares;
|
||||
use Hyperf\HttpServer\Annotation\RequestMapping;
|
||||
use Hyperf\Validation\Annotation\Scene;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
|
||||
#[Controller(prefix: "admin/employee")]
|
||||
#[Middlewares([
|
||||
JwtAuthMiddleware::class,
|
||||
])]
|
||||
class EmployeeController
|
||||
{
|
||||
#[RequestMapping(path: "add", methods: "POST")]
|
||||
#[Scene(scene: "add")]
|
||||
public function add(EmployeeRequest $request)
|
||||
{
|
||||
return (new EmployeeService)->add();
|
||||
}
|
||||
|
||||
#[RequestMapping(path: "edit", methods: "POST")]
|
||||
#[Scene(scene: "edit")]
|
||||
public function edit(EmployeeRequest $request)
|
||||
{
|
||||
return (new EmployeeService)->edit();
|
||||
}
|
||||
|
||||
#[RequestMapping(path: "del", methods: "POST")]
|
||||
#[Scene(scene: "del")]
|
||||
public function delete(EmployeeRequest $request)
|
||||
{
|
||||
return (new EmployeeService)->delete();
|
||||
}
|
||||
|
||||
#[RequestMapping(path: "list", methods: "POST")]
|
||||
#[Scene(scene: "list")]
|
||||
public function list(EmployeeRequest $request)
|
||||
{
|
||||
return (new EmployeeService)->handle();
|
||||
}
|
||||
|
||||
#[RequestMapping(path: "info", methods: "POST")]
|
||||
#[Scene(scene: "info")]
|
||||
public function info(EmployeeRequest $request)
|
||||
{
|
||||
return (new EmployeeService)->get();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user