feat: 扩展奖池、风控与报表能力,新增对账补偿、广播和人工操作接口

This commit is contained in:
2026-05-18 15:09:10 +08:00
parent 9157dcb6a1
commit 6ef41cee76
46 changed files with 1889 additions and 98 deletions

View File

@@ -2,37 +2,23 @@
namespace App\Http\Controllers\Api\V1\Jackpot;
use App\Models\JackpotPool;
use App\Support\ApiResponse;
use Illuminate\Http\Request;
use Illuminate\Http\JsonResponse;
use App\Support\CurrencyFormatter;
use App\Http\Controllers\Controller;
use App\Services\Jackpot\JackpotSummaryService;
/**
* `GET /api/v1/jackpot/summary` 当前奖池水位(公开;玩家端开奖区展示)。
*/
final class JackpotSummaryController extends Controller
{
public function __construct(
private readonly JackpotSummaryService $summary,
) {}
public function __invoke(Request $request): JsonResponse
{
$currency = strtoupper(trim((string) $request->query('currency_code', 'NPR')));
if (strlen($currency) > 16) {
$currency = 'NPR';
}
$pool = JackpotPool::query()
->where('currency_code', $currency)
->where('status', 1)
->first();
$amountMinor = $pool !== null ? (int) $pool->current_amount : 0;
return ApiResponse::success([
'currency_code' => $currency,
'enabled' => $pool !== null,
'current_amount_minor' => $amountMinor,
'current_amount_formatted' => CurrencyFormatter::fromMinor($amountMinor),
]);
return ApiResponse::success($this->summary->summary((string) $request->query('currency_code', 'NPR')));
}
}