From 6c44cd2825d13d0a68374bb1b41517ae8344ca39 Mon Sep 17 00:00:00 2001 From: ctexthuang Date: Wed, 30 Oct 2024 11:04:48 +0800 Subject: [PATCH] feat : user --- app/Controller/Admin/EmployeeController.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/app/Controller/Admin/EmployeeController.php b/app/Controller/Admin/EmployeeController.php index a3f118f..7a928c5 100644 --- a/app/Controller/Admin/EmployeeController.php +++ b/app/Controller/Admin/EmployeeController.php @@ -7,6 +7,7 @@ namespace App\Controller\Admin; use App\Middleware\Admin\JwtAuthMiddleware; use App\Request\Admin\EmployeeRequest; use App\Service\Admin\EmployeeService; +use Exception; use Hyperf\HttpServer\Annotation\Controller; use Hyperf\HttpServer\Annotation\Middlewares; use Hyperf\HttpServer\Annotation\RequestMapping; @@ -22,11 +23,11 @@ class EmployeeController /** * @param EmployeeRequest $request * @return array - * @throws \Exception + * @throws Exception */ #[RequestMapping(path: "add", methods: "POST")] #[Scene(scene: "add")] - public function add(EmployeeRequest $request) + public function add(EmployeeRequest $request): array { return (new EmployeeService)->add(); } @@ -37,7 +38,7 @@ class EmployeeController */ #[RequestMapping(path: "edit", methods: "POST")] #[Scene(scene: "edit")] - public function edit(EmployeeRequest $request) + public function edit(EmployeeRequest $request): array { return (new EmployeeService)->edit(); } @@ -48,7 +49,7 @@ class EmployeeController */ #[RequestMapping(path: "del", methods: "GET")] #[Scene(scene: "del")] - public function delete(EmployeeRequest $request) + public function delete(EmployeeRequest $request): array { return (new EmployeeService)->delete(); } @@ -59,7 +60,7 @@ class EmployeeController */ #[RequestMapping(path: "list", methods: "GET")] #[Scene(scene: "list")] - public function list(EmployeeRequest $request) + public function list(EmployeeRequest $request): array { return (new EmployeeService)->handle(); } @@ -70,7 +71,7 @@ class EmployeeController */ #[RequestMapping(path: "info", methods: "GET")] #[Scene(scene: "info")] - public function info(EmployeeRequest $request) + public function info(EmployeeRequest $request): array { return (new EmployeeService)->get(); } @@ -78,11 +79,11 @@ class EmployeeController /** * @param EmployeeRequest $request * @return array - * @throws \Exception + * @throws Exception */ #[RequestMapping(path: "reset_password", methods: "GET")] #[Scene(scene: "reset_password")] - public function resetPassword(EmployeeRequest $request) + public function resetPassword(EmployeeRequest $request): array { return (new EmployeeService)->resetPassword(); }