refactor: 使用 ApiMessage 统一错误响应格式
- 在多个控制器中引入 ApiMessage,替换原有的 ApiResponse 错误处理逻辑,确保错误信息的一致性与可读性。 - 更新错误返回信息,使用更具语义的键值,提升 API 的可维护性与用户体验。 - 适配相关控制器的请求参数,确保在处理错误时能够正确返回相应的错误信息。
This commit is contained in:
@@ -6,5 +6,25 @@ return [
|
||||
'invalid_credentials' => 'Invalid account or password.',
|
||||
'account_disabled' => 'This account has been disabled.',
|
||||
'permission_denied' => 'You do not have permission to perform this action.',
|
||||
'forbidden' => 'You do not have permission to perform this action.',
|
||||
'settlement_run_skipped' => 'Settlement was not run for this draw (check draw status and published result batch).',
|
||||
'site_access_denied' => 'You do not have access to this site.',
|
||||
'site_rotate_denied' => 'You cannot rotate secrets for this site.',
|
||||
'site_update_denied' => 'You cannot modify this site.',
|
||||
'site_player_access_denied' => 'You do not have access to players under this site.',
|
||||
'player_create_site_forbidden' => 'You cannot create players under this site.',
|
||||
'player_already_registered' => 'This main-site player is already registered.',
|
||||
'player_wallet_balance_blocks_delete' => 'Player wallet still has balance. Clear it before deletion.',
|
||||
'player_has_tickets_blocks_delete' => 'Player has ticket records and cannot be deleted.',
|
||||
'role_cannot_delete_super_admin' => 'Cannot delete the super admin role.',
|
||||
'role_builtin_cannot_delete' => 'Built-in roles cannot be deleted.',
|
||||
'role_has_users_cannot_delete' => 'This role still has assigned admins and cannot be deleted.',
|
||||
'user_cannot_delete_self' => 'Cannot delete your own account.',
|
||||
'user_cannot_delete_last_super_admin' => 'Cannot delete the last super admin.',
|
||||
'super_admin_only_for_roles' => 'Only super admins can manage roles.',
|
||||
'route_name_missing_for_permission' => 'Admin route is missing a route name for permission checks.',
|
||||
'api_resource_not_configured' => 'Admin API resource is not configured: :route',
|
||||
'api_resource_no_permission_binding' => 'Admin API resource has no permission binding: :code',
|
||||
'currency_default_cannot_delete' => 'Default currency cannot be deleted.',
|
||||
'currency_referenced_cannot_delete' => 'Currency is referenced by business data and cannot be deleted: :refs',
|
||||
];
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'success' => [
|
||||
'ok' => 'OK',
|
||||
],
|
||||
|
||||
'validation_failed' => 'The given data was invalid.',
|
||||
'client_error' => 'This request could not be completed.',
|
||||
'invalid_params' => 'Invalid request parameters.',
|
||||
'invalid_settings_group' => 'This settings group is not allowed.',
|
||||
'draw_no_exists' => 'Draw number already exists. Use another draw number or sequence.',
|
||||
'draw_not_found' => 'Draw not found.',
|
||||
'draw_timeline_invalid' => 'Start time must be before close time, and close time must be before draw time.',
|
||||
'draw_not_editable' => 'Only pending draws, or open draws with no bets, can be edited.',
|
||||
'draw_not_deletable' => 'Only pending draws with no bets can be deleted.',
|
||||
@@ -14,4 +21,37 @@ return [
|
||||
'too_many_requests' => 'Too many requests. Please try again later.',
|
||||
'server_error' => 'Something went wrong. Please try again later.',
|
||||
'jackpot_manual_burst_failed' => 'Manual jackpot burst failed: :reason',
|
||||
'config_version_not_draft' => 'This config version is not a draft.',
|
||||
'config_version_cannot_delete_active' => 'Cannot delete the active config version.',
|
||||
'effective_config_not_initialized' => 'Play configuration has not been initialized.',
|
||||
'invalid_or_disabled_currency' => 'Invalid or disabled currency.',
|
||||
'risk_pool_no_remaining_amount' => 'Insufficient remaining amount in the risk pool.',
|
||||
|
||||
'reasons' => [
|
||||
'jackpot_disabled' => 'Jackpot pool is disabled.',
|
||||
'jackpot_pool_empty' => 'Jackpot pool balance is zero.',
|
||||
'jackpot_already_burst_for_draw' => 'Jackpot was already burst for this draw.',
|
||||
'jackpot_manual_no_first_prize_winners' => 'No first-prize winners on this draw.',
|
||||
'jackpot_already_allocated_for_draw' => 'Jackpot was already allocated for this draw.',
|
||||
'draw_not_ready_for_jackpot_burst' => 'Draw is not in settling or settled status.',
|
||||
'draw_result_not_published' => 'Draw results have not been published.',
|
||||
'settlement_batch_not_found' => 'Settlement batch not found for this draw.',
|
||||
'settlement_not_pending_review' => 'Settlement batch is not pending review.',
|
||||
'settlement_not_approved' => 'Settlement batch is not approved.',
|
||||
'draw_has_unsettled_tickets' => 'This draw still has unsettled tickets.',
|
||||
'batch_not_pending_review' => 'Result batch is not pending review.',
|
||||
'draw_not_ready_to_publish' => 'Draw is not ready to publish results.',
|
||||
'batch_result_version_stale' => 'Result batch version is stale. Refresh and try again.',
|
||||
'draw_settlement_in_progress' => 'Settlement is in progress for this draw.',
|
||||
'draw_already_settled' => 'This draw is already settled.',
|
||||
'draw_pending_result_batch_exists' => 'A pending result batch already exists.',
|
||||
'draw_not_closeable' => 'This draw cannot be closed manually.',
|
||||
'draw_not_cancelable' => 'This draw cannot be cancelled.',
|
||||
'draw_has_settled_tickets' => 'This draw has settled tickets.',
|
||||
'draw_not_runnable' => 'RNG cannot be run for this draw.',
|
||||
'draw_not_in_cooldown' => 'Draw is not in cooldown.',
|
||||
'adjustment_delta_zero' => 'Adjustment amount cannot be zero.',
|
||||
'adjustment_reason_required' => 'Adjustment reason is required.',
|
||||
'adjustment_would_make_balance_negative' => 'Adjustment would make pool balance negative.',
|
||||
],
|
||||
];
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
/** PRD 钱包段多语言;NegotiateLotteryLocale 后由 __() 选用 */
|
||||
return [
|
||||
'invalid_currency' => 'Invalid currency code',
|
||||
'order_not_found' => 'Transfer order not found',
|
||||
|
||||
'1001' => 'Insufficient lottery wallet balance',
|
||||
'1002' => 'A previous transfer is still processing; please retry shortly',
|
||||
|
||||
@@ -1,10 +1,30 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'unauthenticated' => 'प्रमाणीकरण छैन वा सेसन समाप्त भएको छ।',
|
||||
'invalid_captcha' => 'क्याप्चा गलत वा समय सकियो।',
|
||||
'invalid_credentials' => 'खाता वा पासवर्ड गलत।',
|
||||
'unauthenticated' => 'लगइन छैन वा सत्र समाप्त भयो।',
|
||||
'invalid_captcha' => 'क्याप्चा गलत वा म्याद सकिएको छ।',
|
||||
'invalid_credentials' => 'खाता वा पासवर्ड गलत छ।',
|
||||
'account_disabled' => 'यो खाता निष्क्रिय गरिएको छ।',
|
||||
'permission_denied' => 'यो कार्य गर्न अनुमति छैन।',
|
||||
'settlement_run_skipped' => 'यस ड्रका लागि बन्दोबस्त चलाइएन (ड्र स्थिति र प्रकाशित नतिजा जाँच गर्नुहोस्)।',
|
||||
'permission_denied' => 'यो कार्य गर्ने अनुमति छैन।',
|
||||
'forbidden' => 'यो कार्य गर्ने अनुमति छैन।',
|
||||
'settlement_run_skipped' => 'यो ड्रको सेटलमेन्ट चलाइएन (ड्र स्थिति र प्रकाशित नतिजा जाँच गर्नुहोस्)।',
|
||||
'site_access_denied' => 'यो साइटमा पहुँच छैन।',
|
||||
'site_rotate_denied' => 'यो साइटको गोप्यियता परिवर्तन गर्न मिल्दैन।',
|
||||
'site_update_denied' => 'यो साइट सम्पादन गर्न मिल्दैन।',
|
||||
'site_player_access_denied' => 'यो साइटका खेलाडीहरूमा पहुँच छैन।',
|
||||
'player_create_site_forbidden' => 'यो साइटमा खेलाडी सिर्जना गर्न मिल्दैन।',
|
||||
'player_already_registered' => 'यो मुख्य साइट खेलाडी पहिले नै दर्ता भइसकेको छ।',
|
||||
'player_wallet_balance_blocks_delete' => 'खेलाडी वालेटमा ब्यालेन्स छ, मेटाउनु अघि खाली गर्नुहोस्।',
|
||||
'player_has_tickets_blocks_delete' => 'खेलाडीसँग टिकट रेकर्ड छ, मेटाउन मिल्दैन।',
|
||||
'role_cannot_delete_super_admin' => 'सुपर एडमिन भूमिका मेटाउन मिल्दैन।',
|
||||
'role_builtin_cannot_delete' => 'बिल्ट-इन भूमिका मेटाउन मिल्दैन।',
|
||||
'role_has_users_cannot_delete' => 'यो भूमिकामा अझै एडमिन छ, मेटाउन मिल्दैन।',
|
||||
'user_cannot_delete_self' => 'आफ्नै खाता मेटाउन मिल्दैन।',
|
||||
'user_cannot_delete_last_super_admin' => 'अन्तिम सुपर एडमिन मेटाउन मिल्दैन।',
|
||||
'super_admin_only_for_roles' => 'भूमिका व्यवस्थापन केवल सुपर एडमिनले गर्न सक्छ।',
|
||||
'route_name_missing_for_permission' => 'एडमिन रुटमा route name छैन, अनुमति जाँच गर्न सकिँदैन।',
|
||||
'api_resource_not_configured' => 'एडमिन API स्रोत कन्फिग गरिएको छैन: :route',
|
||||
'api_resource_no_permission_binding' => 'एडमिन API स्रोतमा अनुमति बाइन्डिङ छैन: :code',
|
||||
'currency_default_cannot_delete' => 'पूर्वनिर्धारित मुद्रा मेटाउन मिल्दैन।',
|
||||
'currency_referenced_cannot_delete' => 'मुद्रा व्यवसाय डाटामा प्रयोग भएको छ, मेटाउन मिल्दैन: :refs',
|
||||
];
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'success' => [
|
||||
'ok' => 'सफल',
|
||||
],
|
||||
|
||||
'validation_failed' => 'दिइएको डाटा अमान्य छ।',
|
||||
'client_error' => 'यो अनुरोध पूरा गर्न सकिएन।',
|
||||
'invalid_params' => 'अनुरोध प्यारामिटर अमान्य छ।',
|
||||
'invalid_settings_group' => 'यो सेटिङ समूह पढ्न अनुमति छैन।',
|
||||
'draw_no_exists' => 'यो ड्र नम्बर पहिले नै छ। अर्को ड्र नम्बर वा क्रम प्रयोग गर्नुहोस्।',
|
||||
'draw_not_found' => 'ड्र फेला परेन।',
|
||||
'draw_timeline_invalid' => 'सुरु समय बन्द समय भन्दा अघि, बन्द समय ड्र समय भन्दा अघि हुनुपर्छ।',
|
||||
'draw_not_editable' => 'केवल pending वा बेट नभएको open ड्र सम्पादन गर्न सकिन्छ।',
|
||||
'draw_not_deletable' => 'केवल pending र बेट नभएको ड्र मेटाउन सकिन्छ।',
|
||||
@@ -14,4 +21,37 @@ return [
|
||||
'too_many_requests' => 'धेरै अनुरोधहरू। कृपया पछि प्रयास गर्नुहोस्।',
|
||||
'server_error' => 'केही गडबड भयो। कृपया पछि प्रयास गर्नुहोस्।',
|
||||
'jackpot_manual_burst_failed' => 'म्यानुअल ज्याकपोट बर्स्ट असफल: :reason',
|
||||
'config_version_not_draft' => 'यो कन्फिग संस्करण ड्राफ्ट होइन।',
|
||||
'config_version_cannot_delete_active' => 'सक्रिय कन्फिग संस्करण मेटाउन मिल्दैन।',
|
||||
'effective_config_not_initialized' => 'प्ले कन्फिग अझै सुरु भएको छैन।',
|
||||
'invalid_or_disabled_currency' => 'मुद्रा अमान्य वा निष्क्रिय छ।',
|
||||
'risk_pool_no_remaining_amount' => 'जोखिम पोलमा बाँकी रकम अपर्याप्त छ।',
|
||||
|
||||
'reasons' => [
|
||||
'jackpot_disabled' => 'ज्याकपोट पोल निष्क्रिय छ।',
|
||||
'jackpot_pool_empty' => 'ज्याकपोट पोल ब्यालेन्स शून्य छ।',
|
||||
'jackpot_already_burst_for_draw' => 'यो ड्रमा पहिले नै बर्स्ट भइसकेको छ।',
|
||||
'jackpot_manual_no_first_prize_winners' => 'यो ड्रमा पहिलो पुरस्कार विजेता छैन।',
|
||||
'jackpot_already_allocated_for_draw' => 'यो ड्रमा ज्याकपोट पहिले नै बाँडिएको छ।',
|
||||
'draw_not_ready_for_jackpot_burst' => 'ड्र settling वा settled अवस्थामा छैन।',
|
||||
'draw_result_not_published' => 'ड्र नतिजा प्रकाशित भएको छैन।',
|
||||
'settlement_batch_not_found' => 'यो ड्रको सेटलमेन्ट ब्याच फेला परेन।',
|
||||
'settlement_not_pending_review' => 'सेटलमेन्ट ब्याच समीक्षामा छैन।',
|
||||
'settlement_not_approved' => 'सेटलमेन्ट ब्याच स्वीकृत छैन।',
|
||||
'draw_has_unsettled_tickets' => 'यो ड्रमा अझै नसेटल टिकट छ।',
|
||||
'batch_not_pending_review' => 'नतिजा ब्याच समीक्षामा छैन।',
|
||||
'draw_not_ready_to_publish' => 'ड्र नतिजा प्रकाशित गर्न तयार छैन।',
|
||||
'batch_result_version_stale' => 'नतिजा संस्करण पुरानो भयो। रिफ्रेस गरेर पुन: प्रयास गर्नुहोस्।',
|
||||
'draw_settlement_in_progress' => 'यो ड्रको सेटलमेन्ट चलिरहेको छ।',
|
||||
'draw_already_settled' => 'यो ड्र पहिले नै सेटल भइसकेको छ।',
|
||||
'draw_pending_result_batch_exists' => 'पेन्डिङ नतिजा ब्याच पहिले नै छ।',
|
||||
'draw_not_closeable' => 'यो ड्र म्यानुअल बन्द गर्न मिल्दैन।',
|
||||
'draw_not_cancelable' => 'यो ड्र रद्द गर्न मिल्दैन।',
|
||||
'draw_has_settled_tickets' => 'यो ड्रमा सेटल भएका टिकट छ।',
|
||||
'draw_not_runnable' => 'यो ड्रमा RNG चलाउन मिल्दैन।',
|
||||
'draw_not_in_cooldown' => 'ड्र कूलडाउन अवस्थामा छैन।',
|
||||
'adjustment_delta_zero' => 'समायोजन रकम ० हुन सक्दैन।',
|
||||
'adjustment_reason_required' => 'समायोजन कारण आवश्यक छ।',
|
||||
'adjustment_would_make_balance_negative' => 'समायोजन पछि पोल ब्यालेन्स ऋणात्मक हुन्छ।',
|
||||
],
|
||||
];
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
return [
|
||||
'invalid_currency' => 'मुद्रा कोड अमान्य',
|
||||
'order_not_found' => 'स्थानान्तरण अर्डर फेला परेन',
|
||||
|
||||
'1001' => 'लटरी वालेट ब्यालेन्स अपर्याप्त',
|
||||
'1002' => 'अघिल्लो स्थानान्तरण अझै प्रक्रियामा छ, पछि प्रयास गर्नुहोस्',
|
||||
|
||||
@@ -6,5 +6,25 @@ return [
|
||||
'invalid_credentials' => '账号或密码错误。',
|
||||
'account_disabled' => '该账号已被禁用。',
|
||||
'permission_denied' => '当前账号无此操作权限。',
|
||||
'forbidden' => '当前账号无此操作权限。',
|
||||
'settlement_run_skipped' => '本期未执行结算(请检查期号状态与已发布开奖批次)。',
|
||||
'site_access_denied' => '无权访问该站点。',
|
||||
'site_rotate_denied' => '无权操作该站点。',
|
||||
'site_update_denied' => '无权修改该站点。',
|
||||
'site_player_access_denied' => '无权访问该站点下的玩家。',
|
||||
'player_create_site_forbidden' => '无权在该站点下创建玩家。',
|
||||
'player_already_registered' => '该主站玩家已在彩票平台注册。',
|
||||
'player_wallet_balance_blocks_delete' => '该玩家钱包仍有余额,请先清空后再删除。',
|
||||
'player_has_tickets_blocks_delete' => '该玩家存在注单记录,无法删除。',
|
||||
'role_cannot_delete_super_admin' => '不能删除超级管理员角色。',
|
||||
'role_builtin_cannot_delete' => '系统内置角色不允许删除。',
|
||||
'role_has_users_cannot_delete' => '该角色下仍有关联管理员,不能删除。',
|
||||
'user_cannot_delete_self' => '不能删除当前登录账号。',
|
||||
'user_cannot_delete_last_super_admin' => '不能删除最后一个超级管理员。',
|
||||
'super_admin_only_for_roles' => '仅超级管理员可管理角色。',
|
||||
'route_name_missing_for_permission' => '后台路由缺少 route name,无法执行资源鉴权。',
|
||||
'api_resource_not_configured' => '后台 API 资源未配置::route',
|
||||
'api_resource_no_permission_binding' => '后台 API 资源未绑定权限动作::code',
|
||||
'currency_default_cannot_delete' => '默认币种不可删除。',
|
||||
'currency_referenced_cannot_delete' => '该币种已被业务数据引用,暂不可删除::refs',
|
||||
];
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'success' => [
|
||||
'ok' => '操作成功',
|
||||
],
|
||||
|
||||
'validation_failed' => '请求参数校验未通过。',
|
||||
'client_error' => '请求无法完成。',
|
||||
'invalid_params' => '请求参数无效。',
|
||||
'invalid_settings_group' => '不允许读取该配置分组。',
|
||||
'draw_no_exists' => '期号已存在,请更换期号或流水号。',
|
||||
'draw_not_found' => '期号不存在。',
|
||||
'draw_timeline_invalid' => '开始时间须早于封盘时间,封盘时间须早于开奖时间。',
|
||||
'draw_not_editable' => '仅「未开始」或「可下注且无注单」的期号可编辑时间。',
|
||||
'draw_not_deletable' => '仅「未开始」且无注单的期号可删除。',
|
||||
@@ -14,4 +21,37 @@ return [
|
||||
'too_many_requests' => '请求过于频繁,请稍后再试。',
|
||||
'server_error' => '服务暂时不可用,请稍后再试。',
|
||||
'jackpot_manual_burst_failed' => '手动爆池失败::reason',
|
||||
'config_version_not_draft' => '配置版本不是草稿状态,无法执行该操作。',
|
||||
'config_version_cannot_delete_active' => '不能删除当前生效中的配置版本。',
|
||||
'effective_config_not_initialized' => '玩法配置尚未初始化。',
|
||||
'invalid_or_disabled_currency' => '币种无效或未启用。',
|
||||
'risk_pool_no_remaining_amount' => '风险池剩余额度不足。',
|
||||
|
||||
'reasons' => [
|
||||
'jackpot_disabled' => '奖池已停用。',
|
||||
'jackpot_pool_empty' => '奖池余额为 0,无法爆池。',
|
||||
'jackpot_already_burst_for_draw' => '该期已执行过爆池。',
|
||||
'jackpot_manual_no_first_prize_winners' => '该期没有头奖中奖注单,无法手动爆池。',
|
||||
'jackpot_already_allocated_for_draw' => '该期已分配过奖池派彩。',
|
||||
'draw_not_ready_for_jackpot_burst' => '期号尚未进入结算中或已结算,无法手动爆池。',
|
||||
'draw_result_not_published' => '该期开奖结果尚未发布。',
|
||||
'settlement_batch_not_found' => '未找到该期的结算批次。',
|
||||
'settlement_not_pending_review' => '结算批次不在待审核状态。',
|
||||
'settlement_not_approved' => '结算批次尚未审核通过。',
|
||||
'draw_has_unsettled_tickets' => '该期仍有未结算注单。',
|
||||
'batch_not_pending_review' => '开奖结果批次不在待审核状态。',
|
||||
'draw_not_ready_to_publish' => '期号状态不允许发布开奖结果。',
|
||||
'batch_result_version_stale' => '开奖结果版本已过期,请刷新后重试。',
|
||||
'draw_settlement_in_progress' => '该期正在结算中,无法发布结果。',
|
||||
'draw_already_settled' => '该期已结算完成。',
|
||||
'draw_pending_result_batch_exists' => '该期已有待审核的开奖批次。',
|
||||
'draw_not_closeable' => '当前期号状态不允许手动封盘。',
|
||||
'draw_not_cancelable' => '当前期号状态不允许取消。',
|
||||
'draw_has_settled_tickets' => '该期已有已结算注单,无法执行此操作。',
|
||||
'draw_not_runnable' => '当前期号不可执行 RNG 开奖。',
|
||||
'draw_not_in_cooldown' => '期号不在冷静期,无法重开。',
|
||||
'adjustment_delta_zero' => '调整金额不能为 0。',
|
||||
'adjustment_reason_required' => '请填写调整原因。',
|
||||
'adjustment_would_make_balance_negative' => '调整后奖池余额不能为负数。',
|
||||
],
|
||||
];
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
return [
|
||||
'invalid_currency' => '币种参数不合法',
|
||||
'order_not_found' => '转账订单不存在',
|
||||
|
||||
'1001' => '彩票钱包余额不足',
|
||||
'1002' => '上一笔转账仍在处理中,请稍后重试',
|
||||
|
||||
Reference in New Issue
Block a user