Files
lotteryLaravel/app/Lottery/ErrorCode.php

38 lines
1.1 KiB
PHP
Raw 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\Lottery;
/**
* HTTP JSON 中与 `ApiResponse` 对齐的业务码常量(对齐 docs/04 §10
* SSO 等特殊场景仍由各模块直接写整数(如 EnsurePlayerApi 使用的 8001
*/
enum ErrorCode: int
{
/** 管理端 API未登录或 Token 无效 */
case AdminUnauthenticated = 8110;
/** 管理端登录:验证码错误或过期 */
case AdminCaptchaInvalid = 8111;
/** 管理端登录:账号或密码不匹配(对外统一措辞) */
case AdminCredentialsInvalid = 8112;
/** 管理端登录:账号已禁用 */
case AdminAccountDisabled = 8113;
/** 表单 / Query 校验失败(见 ValidationException → 422 */
case ValidationFailed = 9001;
/** 资源或路由不存在 */
case NotFound = 9004;
/** 请求过于频繁 */
case TooManyRequests = 9031;
/** `abort(4xx)` 等客户端类 Http 异常HTTP 状态码见响应头;本码作业务归类) */
case ClientHttpError = 9010;
/** 未分类服务端异常(生产环境不向客户端暴露细节) */
case InternalError = 9999;
}