feat: 增强代理节点和代理资料管理功能

- 在 AgentNodeProfileController 中添加对父代理能力授予的验证,确保子代理的权限在父代理范围内。
- 更新多个请求类,统一代理资料字段的验证逻辑,提升代码复用性。
- 引入 AgentProfileFieldRules 以简化代理资料更新请求的规则定义。
- 在 AgentProfile 模型中设置主键为 agent_node_id,确保与代理节点的关联性。
- 更新错误信息,增加对授信额度和占成比例的验证,确保数据一致性。
This commit is contained in:
2026-06-04 10:15:10 +08:00
parent e3ffffad9c
commit 96545f87f6
17 changed files with 565 additions and 22 deletions

View File

@@ -13,4 +13,13 @@ return [
'exceeds_delegation_ceiling' => 'These permissions exceed this node\'s delegation ceiling: :detail',
'permission_exceeds_actor' => 'These permissions exceed what you may grant: :detail',
'permission_catalog_incomplete' => 'Permission catalog is incomplete (missing: :detail). Run migrate and admin-auth-sync.',
'exceeds_parent' => 'Share rate cannot exceed the parent agent.',
'exceeds_available' => 'Credit limit exceeds the parent\'s available allocation.',
'exceeds_limit' => 'Default player rebate cannot exceed the rebate ceiling.',
'invalid_range' => 'Share rate must be between 0 and 100.',
'below_allocated' => 'Credit limit cannot be lower than credit already allocated to sub-agents.',
'parent_cannot_delegate' => 'The parent has not enabled this capability.',
'cannot_create_child_agent' => 'You are not allowed to create sub-agents.',
'cannot_create_player' => 'You are not allowed to create players.',
'primary_account_missing' => 'This agent has no bound login account; username cannot be updated.',
];

View File

@@ -14,4 +14,13 @@ return [
'exceeds_delegation_ceiling' => '下列权限超出本节点下放上限::detail',
'permission_exceeds_actor' => '下列权限超出您可分配的范围::detail',
'permission_catalog_incomplete' => '权限目录不完整,缺少::detail。请联系管理员执行 migrate 与 admin-auth-sync。',
'exceeds_parent' => '占成比例不能超过上级代理。',
'exceeds_available' => '授信额度超出上级可下发额度。',
'exceeds_limit' => '默认玩家回水不能超过回水上限。',
'invalid_range' => '占成比例必须在 0100 之间。',
'below_allocated' => '授信额度不能低于已下发给下级的额度。',
'parent_cannot_delegate' => '上级未开放该能力,无法下放。',
'cannot_create_child_agent' => '当前账号无权创建下级代理。',
'cannot_create_player' => '当前账号无权创建玩家。',
'primary_account_missing' => '该代理尚未绑定登录账号,无法修改登录名。',
];