Files
MemoryBear/api/app/locales/zh/errors.json
wwq 48f3d9b105 feat(quota): refactor quota management and rate limiting services
- Add `API_KEY_RATE_LIMIT_EXCEEDED` error code.
- Refactor `QuotaExceededError` to support resource type localization.
- Optimize rate limiting service by implementing the sliding window algorithm.
- Add rate limit validation for tenant plans.
- Unify quota check decorator to support both synchronous and asynchronous operations.
- Enhance quota usage statistics endpoints.
2026-04-20 15:10:12 +08:00

151 lines
6.0 KiB
JSON
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.
{
"common": {
"internal_error": "服务器内部错误",
"network_error": "网络连接错误",
"timeout": "请求超时",
"service_unavailable": "服务暂时不可用",
"bad_request": "请求参数错误",
"unauthorized": "未授权访问",
"forbidden": "没有权限访问",
"not_found": "请求的资源不存在",
"method_not_allowed": "不支持的请求方法",
"conflict": "资源冲突",
"too_many_requests": "请求过于频繁,请稍后再试",
"validation_failed": "数据验证失败",
"database_error": "数据库操作失败",
"file_operation_error": "文件操作失败"
},
"auth": {
"invalid_credentials": "用户名或密码错误",
"token_expired": "登录已过期,请重新登录",
"token_invalid": "无效的登录令牌",
"token_missing": "缺少登录令牌",
"unauthorized": "未授权访问",
"forbidden": "没有权限执行此操作",
"account_locked": "账户已被锁定",
"account_disabled": "账户已被禁用",
"account_not_verified": "账户未验证",
"password_incorrect": "密码错误",
"password_too_weak": "密码强度不够",
"password_expired": "密码已过期,请修改密码",
"email_not_verified": "邮箱未验证",
"phone_not_verified": "手机号未验证",
"verification_code_invalid": "验证码无效",
"verification_code_expired": "验证码已过期",
"login_failed": "登录失败",
"logout_failed": "登出失败",
"session_expired": "会话已过期",
"already_logged_in": "已经登录",
"not_logged_in": "未登录"
},
"user": {
"not_found": "用户不存在",
"already_exists": "用户已存在",
"email_already_exists": "邮箱已被使用",
"phone_already_exists": "手机号已被使用",
"username_already_exists": "用户名已被使用",
"invalid_email": "邮箱格式不正确",
"invalid_phone": "手机号格式不正确",
"invalid_username": "用户名格式不正确",
"create_failed": "创建用户失败",
"update_failed": "更新用户失败",
"delete_failed": "删除用户失败",
"cannot_delete_self": "不能删除自己",
"cannot_update_self_role": "不能修改自己的角色",
"profile_update_failed": "更新个人资料失败",
"avatar_upload_failed": "上传头像失败",
"password_change_failed": "修改密码失败",
"old_password_incorrect": "原密码错误"
},
"workspace": {
"not_found": "工作空间不存在",
"already_exists": "工作空间已存在",
"name_required": "工作空间名称不能为空",
"name_too_long": "工作空间名称过长",
"create_failed": "创建工作空间失败",
"update_failed": "更新工作空间失败",
"delete_failed": "删除工作空间失败",
"permission_denied": "没有权限访问此工作空间",
"not_member": "不是工作空间成员",
"already_member": "已经是工作空间成员",
"member_limit_reached": "成员数量已达上限",
"cannot_leave_last_manager": "不能离开,您是最后一个管理员",
"cannot_remove_last_manager": "不能移除最后一个管理员",
"cannot_remove_self": "不能移除自己",
"invite_not_found": "邀请不存在",
"invite_expired": "邀请已过期",
"invite_already_accepted": "邀请已被接受",
"invite_already_revoked": "邀请已被撤销",
"invite_send_failed": "发送邀请失败",
"archived": "工作空间已归档",
"suspended": "工作空间已暂停"
},
"tenant": {
"not_found": "租户不存在",
"already_exists": "租户已存在",
"create_failed": "创建租户失败",
"update_failed": "更新租户失败",
"delete_failed": "删除租户失败",
"suspended": "租户已暂停",
"expired": "租户已过期",
"license_invalid": "许可证无效",
"license_expired": "许可证已过期",
"quota_exceeded": "配额已超限"
},
"file": {
"not_found": "文件不存在",
"upload_failed": "文件上传失败",
"download_failed": "文件下载失败",
"delete_failed": "文件删除失败",
"too_large": "文件大小超过限制",
"invalid_type": "不支持的文件类型",
"invalid_format": "文件格式不正确",
"corrupted": "文件已损坏",
"storage_full": "存储空间已满",
"access_denied": "没有权限访问此文件"
},
"api": {
"rate_limit_exceeded": "API调用频率超限",
"quota_exceeded": "{resource} 配额已超限",
"invalid_api_key": "无效的API密钥",
"api_key_expired": "API密钥已过期",
"api_key_revoked": "API密钥已被撤销",
"endpoint_not_found": "API端点不存在",
"method_not_allowed": "不支持的请求方法",
"invalid_request": "无效的请求",
"missing_parameter": "缺少必需参数:{param}",
"invalid_parameter": "参数无效:{param}",
"api_key_rate_limit_exceeded": "API Key 的 QPS 限制({rate_limit})超过租户套餐上限({limit}"
},
"database": {
"connection_failed": "数据库连接失败",
"query_failed": "数据库查询失败",
"transaction_failed": "数据库事务失败",
"constraint_violation": "数据约束冲突",
"duplicate_key": "数据重复",
"foreign_key_violation": "外键约束冲突",
"deadlock": "数据库死锁"
},
"validation": {
"invalid_input": "输入数据无效",
"missing_field": "缺少必需字段:{field}",
"invalid_field": "字段无效:{field}",
"field_too_long": "字段过长:{field}",
"field_too_short": "字段过短:{field}",
"invalid_format": "格式不正确:{field}",
"invalid_value": "值无效:{field}",
"out_of_range": "值超出范围:{field}"
},
"quota_resources": {
"workspace": "工作空间",
"app": "应用",
"skill": "技能",
"knowledge_capacity": "知识库容量",
"memory_engine": "记忆引擎",
"end_user": "终端用户",
"model": "模型",
"ontology_project": "本体工程",
"api_ops_rate_limit": "API 操作速率"
}
}