<?php


namespace app\http;

enum HttpStatus: int
{
    case API_SUCCESS = 0;
    case API_ERROR = 1;
    case UNAUTHORIZED = 401;
    case FORBIDDEN = 403;

    static function message(self $status): string
    {
        return match ($status) {
            self::API_SUCCESS => '操作成功',
            self::API_ERROR => '操作失败',
            self::UNAUTHORIZED => '未授权访问',
            self::FORBIDDEN => '禁止访问',
        };
    }
}


