feat: 增强玩家 API,新增 locale 和时间字段,更新钱包 API 以支持可用余额计算,添加错误码与多语言支持
This commit is contained in:
23
app/Exceptions/WalletOperationException.php
Normal file
23
app/Exceptions/WalletOperationException.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Exceptions;
|
||||
|
||||
use App\Lottery\ErrorCode;
|
||||
use App\Support\ApiResponse;
|
||||
use RuntimeException;
|
||||
|
||||
/**
|
||||
* 玩家钱包划转等业务失败时抛出,由控制器捕获并转为 {@see ApiResponse} JSON。
|
||||
*
|
||||
* @property-read int $lotteryCode {@see ErrorCode}
|
||||
*/
|
||||
final class WalletOperationException extends RuntimeException
|
||||
{
|
||||
public function __construct(
|
||||
string $message,
|
||||
public readonly int $lotteryCode,
|
||||
public readonly int $httpStatus = 400,
|
||||
) {
|
||||
parent::__construct($message);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user