-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
177 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace app\Exception; | ||
|
||
use app\Enum\ApiStatus; | ||
|
||
/** | ||
* 用户已封禁. | ||
*/ | ||
class MemberBandedException extends BaseException | ||
{ | ||
public function __construct(string $message = '用户已封禁', int $code = 0, \Throwable $previous = null) | ||
{ | ||
parent::__construct($message, $code, $previous); | ||
} | ||
|
||
/** | ||
* 获取状态码 | ||
*/ | ||
public function getStatusCode(): int | ||
{ | ||
return ApiStatus::MEMBER_BANDED; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace app\Exception; | ||
|
||
use app\Enum\ApiStatus; | ||
|
||
/** | ||
* 用户状态异常. | ||
*/ | ||
class MemberStatusAnomalyException extends BaseException | ||
{ | ||
public function __construct(string $message = '用户状态异常', int $code = 0, \Throwable $previous = null) | ||
{ | ||
parent::__construct($message, $code, $previous); | ||
} | ||
|
||
/** | ||
* 获取状态码 | ||
*/ | ||
public function getStatusCode(): int | ||
{ | ||
return ApiStatus::MEMBER_STATUS_ANOMALY; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace app\Module\Member\Enum; | ||
|
||
use Imi\Enum\Annotation\EnumItem; | ||
use Imi\Enum\BaseEnum; | ||
|
||
class MemberStatus extends BaseEnum | ||
{ | ||
#[EnumItem(text: '正常')] | ||
public const NORMAL = 1; | ||
|
||
#[EnumItem(text: '封禁')] | ||
public const BANDED = 2; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters