feat(admin,api,player): 代理层级管理、额度上下分与玩家钱包详情

新增代理管理器与二级代理体系,完善信用额度/上下分上下文与冻结策略;代理端玩家与子代理管理增强;玩家端新增钱包详情页与交易筛选优化。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-08 15:34:12 +08:00
parent b2216abd0c
commit 414998ce36
54 changed files with 6641 additions and 481 deletions

View File

@@ -3,12 +3,21 @@ import { PrismaService } from '../prisma/prisma.service';
export const PLAYER_ALLOW_PASSWORD_CHANGE = 'player.allow_password_change';
export const PLAYER_ALLOW_USERNAME_CHANGE = 'player.allow_username_change';
export const AGENT_SUSPEND_FREEZE_DIRECT_PLAYERS = 'agent.suspend_freeze_direct_players';
export const AGENT_SUSPEND_BLOCK_PLAYER_LOGIN = 'agent.suspend_block_player_login';
export type PlayerAccountSettings = {
allowPasswordChange: boolean;
allowUsernameChange: boolean;
};
export type AgentSuspendSettings = {
/** 停用代理时是否允许级联冻结其直属玩家(需管理员显式勾选) */
suspendFreezeDirectPlayers: boolean;
/** 上级代理停用时是否禁止其直属玩家登录 */
suspendBlockPlayerLogin: boolean;
};
@Injectable()
export class SystemConfigService {
constructor(private prisma: PrismaService) {}
@@ -56,4 +65,30 @@ export class SystemConfigService {
}
return this.getPlayerAccountSettings();
}
async getAgentSuspendSettings(): Promise<AgentSuspendSettings> {
const [suspendFreezeDirectPlayers, suspendBlockPlayerLogin] = await Promise.all([
this.getBoolean(AGENT_SUSPEND_FREEZE_DIRECT_PLAYERS, false),
this.getBoolean(AGENT_SUSPEND_BLOCK_PLAYER_LOGIN, false),
]);
return { suspendFreezeDirectPlayers, suspendBlockPlayerLogin };
}
async updateAgentSuspendSettings(data: Partial<AgentSuspendSettings>) {
if (data.suspendFreezeDirectPlayers !== undefined) {
await this.setBoolean(
AGENT_SUSPEND_FREEZE_DIRECT_PLAYERS,
data.suspendFreezeDirectPlayers,
'停用代理时是否允许级联冻结直属玩家',
);
}
if (data.suspendBlockPlayerLogin !== undefined) {
await this.setBoolean(
AGENT_SUSPEND_BLOCK_PLAYER_LOGIN,
data.suspendBlockPlayerLogin,
'上级代理停用时是否禁止直属玩家登录',
);
}
return this.getAgentSuspendSettings();
}
}