Skip to content

Commit 0ec066c

Browse files
authored
added(JwtAuth): 添加用户 和当前用户 Interface (#140)
* added(JwtAuth): 添加用户 和当前用户 Interface - 新增 CurrentUserInterface 和 UserInterface - 定义了用户相关的方法和属性 - 为后续的用户认证和权限管理提供接口基础 * fix review * fix cs-fix
1 parent 1fd5d67 commit 0ec066c

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

Interfaces/CurrentUserInterface.php

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
/**
5+
* This file is part of MineAdmin.
6+
*
7+
* @link https://www.mineadmin.com
8+
* @document https://doc.mineadmin.com
9+
* @contact root@imoi.cn
10+
* @license https://github.com/mineadmin/MineAdmin/blob/master/LICENSE
11+
*/
12+
13+
namespace Mine\JwtAuth\Interfaces;
14+
15+
interface CurrentUserInterface
16+
{
17+
public function user(): ?UserInterface;
18+
19+
public function refresh(): array;
20+
21+
public function id(): int;
22+
23+
public function isSuperAdmin(): bool;
24+
}

Interfaces/UserInterface.php

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
/**
5+
* This file is part of MineAdmin.
6+
*
7+
* @link https://www.mineadmin.com
8+
* @document https://doc.mineadmin.com
9+
* @contact root@imoi.cn
10+
* @license https://github.com/mineadmin/MineAdmin/blob/master/LICENSE
11+
*/
12+
13+
namespace Mine\JwtAuth\Interfaces;
14+
15+
use Hyperf\Database\Model\Relations\BelongsToMany;
16+
17+
interface UserInterface
18+
{
19+
public function roles(): BelongsToMany;
20+
21+
public function verifyPassword(string $password): bool;
22+
23+
public function resetPassword(): void;
24+
25+
public function isSuperAdmin(): bool;
26+
}

0 commit comments

Comments
 (0)