Files
spa-api/app/Enum/UserStatusEnum.php
2025-05-05 14:20:17 +08:00

24 lines
452 B
PHP
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
namespace App\Enum;
/**
* 状态码定义
*/
enum UserStatusEnum: int
{
// 状态 0:正常 1:冻结 2:封号 3:注销
case NORMAL = 0;
case DISABLE = 1;
case DELETED = 2;
public function description(): string
{
return match ($this) {
self::NORMAL => '正常',
self::DISABLE => '冻结',
self::DELETED => '注销',
default => '未知',
};
}
}