Skip to content

Commit 86e883e

Browse files
authored
refactor: simplify UserController by removing PassportService dependency and updating login method (#647)
* refactor: simplify UserController by removing PassportService dependency and updating login method * Apply cs fix
1 parent c60a937 commit 86e883e

1 file changed

Lines changed: 3 additions & 11 deletions

File tree

app/Http/Api/Controller/V1/UserController.php

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,12 @@
1515
use App\Http\Api\Request\V1\UserRequest;
1616
use App\Http\Common\Controller\AbstractController;
1717
use App\Http\Common\Result;
18-
use App\Service\PassportService;
1918
use Hyperf\Swagger\Annotation\HyperfServer;
2019
use Hyperf\Swagger\Annotation\Post;
2120

2221
#[HyperfServer(name: 'http')]
2322
final class UserController extends AbstractController
2423
{
25-
public function __construct(
26-
private readonly PassportService $passportService
27-
) {}
28-
2924
#[Post(
3025
path: '/api/v1/login',
3126
operationId: 'ApiV1Login',
@@ -34,11 +29,8 @@ public function __construct(
3429
)]
3530
public function login(UserRequest $request): Result
3631
{
37-
return $this->success(
38-
$this->passportService->login(
39-
$request->input('username'),
40-
$request->input('password')
41-
)
42-
);
32+
$validated = $request->validated();
33+
// your login logic here
34+
return $this->success();
4335
}
4436
}

0 commit comments

Comments
 (0)