feat: 增强玩家 API,新增 locale 和时间字段,更新钱包 API 以支持可用余额计算,添加错误码与多语言支持

This commit is contained in:
2026-05-09 15:05:46 +08:00
parent f1b38ef421
commit a0f86a4e36
36 changed files with 2523 additions and 34 deletions

View File

@@ -0,0 +1,33 @@
<?php
namespace App\Services\Wallet;
use App\Models\Player;
/**
* 主站钱包对接:转入时扣主站余额,转出时给主站加款。
*
* 幂等键由彩票侧生成并与 transfer_orders.idempotent_key 对齐,主站应按同一键去重。
*/
interface MainSiteWalletGateway
{
/**
* 转入场景:主站钱包扣款 彩票钱包加款。
*/
public function debitMainForLotteryDeposit(
Player $player,
string $currencyCode,
int $amountMinor,
string $idempotentKey,
): MainSiteWalletResult;
/**
* 转出场景:给主站钱包加款(彩票侧已在本地扣减)。
*/
public function creditMainForLotteryWithdraw(
Player $player,
string $currencyCode,
int $amountMinor,
string $idempotentKey,
): MainSiteWalletResult;
}