diff --git a/ErrorCode.md b/ErrorCode.md new file mode 100644 index 0000000..9c36c73 --- /dev/null +++ b/ErrorCode.md @@ -0,0 +1,58 @@ +## 错误码定义 + +#### 通用错误码(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 | + +#### 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 | 409 | 重复支付或订单冲突 | Duplicate payment or order conflict | +| 4005 | 500 | 支付系统错误 | Payment system error | +| 4006 | 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 | \ No newline at end of file