ql_apimanager_backend/ErrorCode.md
2024-12-08 20:35:47 +08:00

64 lines
4.3 KiB
Markdown
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.

## 错误码定义
#### 通用错误码1xxx
| 错误码 | HTTP状态码 | 描述 | Message |
| ------ | ---------- | -------------------- | --------------------- |
| 1000 | 200 | 成功 | Success |
| 1001 | 400 | 参数错误 | Invalid parameters |
| 1002 | 401 | 用户未登录或认证失败 | Unauthorized |
| 1003 | 403 | 无权限访问 | Forbidden |
| 1004 | 404 | 资源未找到 | Resource not found |
| 1005 | 500 | 服务器内部错误 | Internal server error |
| 1006 | 503 | 服务暂时不可用 | Service unavailable |
#### 用户模块错误码2xxx
| 错误码 | HTTP状态码 | 描述 | Message |
| ------ | ---------- | -------------------- | ----------------------------- |
| 2000 | 200 | 登录成功 | Login successful |
| 2001 | 401 | 用户名或密码错误 | Invalid username or password |
| 2002 | 401 | 用户账户被禁用 | User account is disabled |
| 2003 | 409 | 用户名已存在 | Username already exists |
| 2004 | 404 | 用户不存在 | User not found |
| 2005 | 409 | 邮箱已存在 | Email already exists |
| 2006 | 403 | 用户无权限进行该操作 | Permission denied |
| 2007 | 400 | 密码重置失败 | Password reset failed |
| 2008 | 403 | 凭证到期或无效 | Token expires or is invalid |
| 2009 | 403 | 刷新令牌到期或无效 | Refresh expires or is invalid |
#### API模块错误码3xxx
| 错误码 | HTTP状态码 | 描述 | Message |
| ------ | ---------- | ------------------------- | ------------------------------------------ |
| 3000 | 200 | API调用成功 | API call successful |
| 3001 | 403 | API访问受限 | API access restricted |
| 3002 | 404 | API不存在 | API not found |
| 3003 | 429 | API调用次数超限 | API call limit exceeded |
| 3004 | 403 | 未购买该API套餐或权限不足 | API package not purchased or access denied |
| 3005 | 500 | API调用失败服务器错误 | API call failed, server error |
#### 套餐与支付模块错误码4xxx
| 错误码 | HTTP状态码 | 描述 | Message |
| ------ | ---------- | ------------------ | ------------------------------------ |
| 4000 | 200 | 支付成功 | Payment successful |
| 4001 | 400 | 支付请求无效 | Invalid payment request |
| 4002 | 402 | 支付失败,余额不足 | Payment failed, insufficient balance |
| 4003 | 404 | 订单未找到 | Order not found |
| 4004 | 404 | 套餐未找到 | Package not found |
| 4005 | 409 | 重复支付或订单冲突 | Duplicate payment or order conflict |
| 4006 | 500 | 支付系统错误 | Payment system error |
| 4007 | 200 | 退款成功 | Refund successful |
#### 日志与系统模块错误码5xxx
| 错误码 | HTTP状态码 | 描述 | Message |
| ------ | ---------- | ------------------ | -------------------------- |
| 5000 | 200 | 日志查询成功 | Log retrieval successful |
| 5001 | 404 | 日志记录未找到 | Log record not found |
| 5002 | 500 | 日志服务异常 | Log service error |
| 5003 | 403 | 无权限查看操作日志 | No permission to view logs |
| 5004 | 500 | 邮件发送错误 | Email send error |
| 5005 | 400 | 验证码错误 | ValidateCode Error |
| 5006 | 404 | 配置不存在 | Config not found |