feat : user

This commit is contained in:
2024-10-30 11:04:48 +08:00
parent ad89cdeb83
commit 6c44cd2825

View File

@@ -7,6 +7,7 @@ namespace App\Controller\Admin;
use App\Middleware\Admin\JwtAuthMiddleware; use App\Middleware\Admin\JwtAuthMiddleware;
use App\Request\Admin\EmployeeRequest; use App\Request\Admin\EmployeeRequest;
use App\Service\Admin\EmployeeService; use App\Service\Admin\EmployeeService;
use Exception;
use Hyperf\HttpServer\Annotation\Controller; use Hyperf\HttpServer\Annotation\Controller;
use Hyperf\HttpServer\Annotation\Middlewares; use Hyperf\HttpServer\Annotation\Middlewares;
use Hyperf\HttpServer\Annotation\RequestMapping; use Hyperf\HttpServer\Annotation\RequestMapping;
@@ -22,11 +23,11 @@ class EmployeeController
/** /**
* @param EmployeeRequest $request * @param EmployeeRequest $request
* @return array * @return array
* @throws \Exception * @throws Exception
*/ */
#[RequestMapping(path: "add", methods: "POST")] #[RequestMapping(path: "add", methods: "POST")]
#[Scene(scene: "add")] #[Scene(scene: "add")]
public function add(EmployeeRequest $request) public function add(EmployeeRequest $request): array
{ {
return (new EmployeeService)->add(); return (new EmployeeService)->add();
} }
@@ -37,7 +38,7 @@ class EmployeeController
*/ */
#[RequestMapping(path: "edit", methods: "POST")] #[RequestMapping(path: "edit", methods: "POST")]
#[Scene(scene: "edit")] #[Scene(scene: "edit")]
public function edit(EmployeeRequest $request) public function edit(EmployeeRequest $request): array
{ {
return (new EmployeeService)->edit(); return (new EmployeeService)->edit();
} }
@@ -48,7 +49,7 @@ class EmployeeController
*/ */
#[RequestMapping(path: "del", methods: "GET")] #[RequestMapping(path: "del", methods: "GET")]
#[Scene(scene: "del")] #[Scene(scene: "del")]
public function delete(EmployeeRequest $request) public function delete(EmployeeRequest $request): array
{ {
return (new EmployeeService)->delete(); return (new EmployeeService)->delete();
} }
@@ -59,7 +60,7 @@ class EmployeeController
*/ */
#[RequestMapping(path: "list", methods: "GET")] #[RequestMapping(path: "list", methods: "GET")]
#[Scene(scene: "list")] #[Scene(scene: "list")]
public function list(EmployeeRequest $request) public function list(EmployeeRequest $request): array
{ {
return (new EmployeeService)->handle(); return (new EmployeeService)->handle();
} }
@@ -70,7 +71,7 @@ class EmployeeController
*/ */
#[RequestMapping(path: "info", methods: "GET")] #[RequestMapping(path: "info", methods: "GET")]
#[Scene(scene: "info")] #[Scene(scene: "info")]
public function info(EmployeeRequest $request) public function info(EmployeeRequest $request): array
{ {
return (new EmployeeService)->get(); return (new EmployeeService)->get();
} }
@@ -78,11 +79,11 @@ class EmployeeController
/** /**
* @param EmployeeRequest $request * @param EmployeeRequest $request
* @return array * @return array
* @throws \Exception * @throws Exception
*/ */
#[RequestMapping(path: "reset_password", methods: "GET")] #[RequestMapping(path: "reset_password", methods: "GET")]
#[Scene(scene: "reset_password")] #[Scene(scene: "reset_password")]
public function resetPassword(EmployeeRequest $request) public function resetPassword(EmployeeRequest $request): array
{ {
return (new EmployeeService)->resetPassword(); return (new EmployeeService)->resetPassword();
} }