refactor:拆分 API 路由与请求校验,统一 final 类和代码风格

This commit is contained in:
2026-05-13 11:54:40 +08:00
parent 5d2dbdbe1d
commit 805847954d
281 changed files with 1886 additions and 1308 deletions

View File

@@ -1,10 +1,10 @@
<?php
use App\Lottery\ErrorCode;
use App\Models\AdminUser;
use App\Lottery\ErrorCode;
use Illuminate\Support\Str;
use App\Services\AdminCaptchaService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Str;
uses(RefreshDatabase::class);

View File

@@ -1,12 +1,12 @@
<?php
use App\Models\AdminUser;
use App\Models\Draw;
use App\Models\Player;
use App\Models\AdminUser;
use App\Models\TicketItem;
use App\Models\TicketOrder;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Hash;
use Illuminate\Foundation\Testing\RefreshDatabase;
uses(RefreshDatabase::class);

View File

@@ -1,10 +1,10 @@
<?php
use App\Models\AdminUser;
use App\Models\Draw;
use App\Models\RiskPool;
use Illuminate\Foundation\Testing\RefreshDatabase;
use App\Models\AdminUser;
use Illuminate\Support\Facades\Hash;
use Illuminate\Foundation\Testing\RefreshDatabase;
uses(RefreshDatabase::class);

View File

@@ -1,13 +1,13 @@
<?php
use App\Lottery\DrawResultBatchStatus;
use App\Models\AdminUser;
use App\Models\Draw;
use App\Models\DrawResultBatch;
use App\Models\DrawResultItem;
use Carbon\Carbon;
use Illuminate\Foundation\Testing\RefreshDatabase;
use App\Models\Draw;
use App\Models\AdminUser;
use App\Models\DrawResultItem;
use App\Models\DrawResultBatch;
use Illuminate\Support\Facades\Hash;
use App\Lottery\DrawResultBatchStatus;
use Illuminate\Foundation\Testing\RefreshDatabase;
uses(RefreshDatabase::class);

View File

@@ -1,16 +1,16 @@
<?php
use App\Lottery\ErrorCode;
use App\Models\AuditLog;
use App\Models\AdminRole;
use App\Models\AdminUser;
use App\Models\AuditLog;
use App\Models\ReconcileJob;
use App\Models\ReportJob;
use App\Lottery\ErrorCode;
use App\Models\ReconcileJob;
use App\Services\AuditLogger;
use App\Support\AdminPermissionBridge;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Hash;
use App\Support\AdminPermissionBridge;
use Illuminate\Foundation\Testing\RefreshDatabase;
uses(RefreshDatabase::class);

View File

@@ -1,11 +1,11 @@
<?php
use App\Models\AdminUser;
use App\Models\Draw;
use App\Models\RiskPool;
use App\Models\AdminUser;
use App\Models\RiskPoolLockLog;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Hash;
use Illuminate\Foundation\Testing\RefreshDatabase;
uses(RefreshDatabase::class);

View File

@@ -2,8 +2,8 @@
use App\Models\AdminUser;
use App\Models\JackpotPool;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Hash;
use Illuminate\Foundation\Testing\RefreshDatabase;
uses(RefreshDatabase::class);

View File

@@ -1,12 +1,12 @@
<?php
use App\Lottery\ErrorCode;
use App\Models\AdminRole;
use App\Models\AdminUser;
use App\Support\AdminPermissionBridge;
use Illuminate\Foundation\Testing\RefreshDatabase;
use App\Lottery\ErrorCode;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Hash;
use App\Support\AdminPermissionBridge;
use Illuminate\Foundation\Testing\RefreshDatabase;
uses(RefreshDatabase::class);

View File

@@ -1,13 +1,13 @@
<?php
use App\Lottery\ErrorCode;
use App\Models\AdminUser;
use App\Models\Player;
use App\Models\AdminUser;
use App\Models\WalletTxn;
use App\Lottery\ErrorCode;
use App\Models\PlayerWallet;
use App\Models\TransferOrder;
use App\Models\WalletTxn;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Hash;
use Illuminate\Foundation\Testing\RefreshDatabase;
uses(RefreshDatabase::class);

View File

@@ -1,9 +1,9 @@
<?php
use App\Models\AuditLog;
use Illuminate\Http\Request;
use App\Services\AuditLogger;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Http\Request;
uses(RefreshDatabase::class);

View File

@@ -1,20 +1,20 @@
<?php
use App\Events\DrawCountdownBroadcast;
use App\Events\DrawStatusChangeBroadcast;
use App\Lottery\DrawResultBatchStatus;
use App\Lottery\DrawStatus;
use App\Models\AdminUser;
use App\Models\Draw;
use App\Models\DrawResultBatch;
use App\Models\DrawResultItem;
use App\Models\SettlementBatch;
use App\Services\Draw\DrawPlannerService;
use App\Services\Draw\DrawTickService;
use Carbon\Carbon;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Event;
use App\Models\Draw;
use App\Models\AdminUser;
use App\Lottery\DrawStatus;
use App\Models\DrawResultItem;
use App\Models\DrawResultBatch;
use App\Models\SettlementBatch;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Event;
use App\Events\DrawCountdownBroadcast;
use App\Lottery\DrawResultBatchStatus;
use App\Services\Draw\DrawTickService;
use App\Events\DrawStatusChangeBroadcast;
use App\Services\Draw\DrawPlannerService;
use Illuminate\Foundation\Testing\RefreshDatabase;
uses(RefreshDatabase::class);

View File

@@ -1,10 +1,10 @@
<?php
use App\Lottery\DrawResultBatchStatus;
use App\Lottery\DrawStatus;
use App\Models\Draw;
use App\Models\DrawResultBatch;
use App\Lottery\DrawStatus;
use App\Models\DrawResultItem;
use App\Models\DrawResultBatch;
use App\Lottery\DrawResultBatchStatus;
use Illuminate\Foundation\Testing\RefreshDatabase;
uses(RefreshDatabase::class);

View File

@@ -1,24 +1,24 @@
<?php
use App\Lottery\DrawResultBatchStatus;
use App\Lottery\DrawStatus;
use App\Models\Draw;
use App\Models\DrawResultBatch;
use App\Models\DrawResultItem;
use App\Models\JackpotContribution;
use App\Models\JackpotPayoutLog;
use App\Models\JackpotPool;
use App\Models\Player;
use App\Models\PlayerWallet;
use App\Models\TicketItem;
use App\Lottery\DrawStatus;
use App\Models\JackpotPool;
use App\Models\TicketOrder;
use App\Services\Draw\DrawPrizeLayout;
use App\Services\Settlement\SettlementOrchestrator;
use App\Models\PlayerWallet;
use App\Models\DrawResultItem;
use App\Models\DrawResultBatch;
use App\Models\JackpotPayoutLog;
use App\Models\JackpotContribution;
use Database\Seeders\CurrencySeeder;
use Database\Seeders\PlayTypeSeeder;
use App\Lottery\DrawResultBatchStatus;
use App\Services\Draw\DrawPrizeLayout;
use Database\Seeders\LotterySettingsSeeder;
use Database\Seeders\OperationalConfigV1Seeder;
use Database\Seeders\PlayTypeSeeder;
use Illuminate\Foundation\Testing\RefreshDatabase;
use App\Services\Settlement\SettlementOrchestrator;
uses(RefreshDatabase::class);

View File

@@ -2,8 +2,8 @@
use App\Models\LotterySetting;
use App\Services\LotterySettings;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Cache;
use Illuminate\Foundation\Testing\RefreshDatabase;
uses(RefreshDatabase::class);

View File

@@ -1,11 +1,11 @@
<?php
use App\Lottery\ConfigVersionStatus;
use App\Models\Currency;
use App\Models\OddsItem;
use App\Models\OddsVersion;
use App\Models\PlayType;
use App\Models\OddsVersion;
use App\Support\OddsStandardScopes;
use App\Lottery\ConfigVersionStatus;
use Database\Seeders\CurrencySeeder;
use Database\Seeders\PlayTypeSeeder;
use Illuminate\Foundation\Testing\RefreshDatabase;

View File

@@ -10,21 +10,21 @@
* 运行php artisan test tests/Feature/OperationalConfigAcceptanceTest.php
*/
use App\Lottery\ConfigVersionStatus;
use App\Lottery\DrawStatus;
use App\Models\AdminUser;
use App\Models\AuditLog;
use App\Models\Draw;
use App\Models\OddsVersion;
use App\Models\Player;
use App\Models\AuditLog;
use App\Models\PlayType;
use App\Models\AdminUser;
use App\Lottery\DrawStatus;
use App\Models\OddsVersion;
use App\Models\RiskCapVersion;
use Database\Seeders\CurrencySeeder;
use Database\Seeders\OperationalConfigV1Seeder;
use Database\Seeders\PlayTypeSeeder;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\DB;
use App\Lottery\ConfigVersionStatus;
use Database\Seeders\CurrencySeeder;
use Database\Seeders\PlayTypeSeeder;
use Illuminate\Support\Facades\Hash;
use Database\Seeders\OperationalConfigV1Seeder;
use Illuminate\Foundation\Testing\RefreshDatabase;
uses(RefreshDatabase::class);

View File

@@ -1,14 +1,14 @@
<?php
use App\Lottery\ConfigVersionStatus;
use App\Models\PlayType;
use App\Models\AdminUser;
use App\Models\PlayConfigVersion;
use App\Models\PlayType;
use App\Lottery\ConfigVersionStatus;
use Database\Seeders\CurrencySeeder;
use Database\Seeders\OperationalConfigV1Seeder;
use Database\Seeders\PlayTypeSeeder;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Hash;
use Database\Seeders\OperationalConfigV1Seeder;
use Illuminate\Foundation\Testing\RefreshDatabase;
uses(RefreshDatabase::class);

View File

@@ -1,10 +1,10 @@
<?php
use App\Lottery\ErrorCode;
use App\Models\Player;
use Firebase\JWT\JWT;
use Illuminate\Foundation\Testing\RefreshDatabase;
use App\Models\Player;
use App\Lottery\ErrorCode;
use Symfony\Component\HttpFoundation\Response;
use Illuminate\Foundation\Testing\RefreshDatabase;
uses(RefreshDatabase::class);

View File

@@ -1,10 +1,10 @@
<?php
use App\Models\PlayType;
use App\Services\Settlement\Matchers\NoopSettlementMatcher;
use App\Services\Settlement\SettlementMatcherRegistry;
use Database\Seeders\PlayTypeSeeder;
use Illuminate\Foundation\Testing\RefreshDatabase;
use App\Services\Settlement\SettlementMatcherRegistry;
use App\Services\Settlement\Matchers\NoopSettlementMatcher;
uses(RefreshDatabase::class);

View File

@@ -1,23 +1,23 @@
<?php
use App\Lottery\DrawResultBatchStatus;
use App\Lottery\DrawStatus;
use App\Models\Draw;
use App\Models\DrawResultBatch;
use App\Models\DrawResultItem;
use App\Models\Player;
use App\Models\PlayerWallet;
use App\Models\SettlementBatch;
use App\Models\TicketItem;
use App\Models\TicketOrder;
use App\Models\WalletTxn;
use App\Services\Draw\DrawPrizeLayout;
use App\Services\Settlement\SettlementOrchestrator;
use App\Models\TicketItem;
use App\Lottery\DrawStatus;
use App\Models\TicketOrder;
use App\Models\PlayerWallet;
use App\Models\DrawResultItem;
use App\Models\DrawResultBatch;
use App\Models\SettlementBatch;
use Database\Seeders\CurrencySeeder;
use Database\Seeders\PlayTypeSeeder;
use App\Lottery\DrawResultBatchStatus;
use App\Services\Draw\DrawPrizeLayout;
use Database\Seeders\LotterySettingsSeeder;
use Database\Seeders\OperationalConfigV1Seeder;
use Database\Seeders\PlayTypeSeeder;
use Illuminate\Foundation\Testing\RefreshDatabase;
use App\Services\Settlement\SettlementOrchestrator;
uses(RefreshDatabase::class);

View File

@@ -4,31 +4,31 @@
* §14.5 测试任务 / §14.6 完成标准玩法命中、未中奖、派彩入彩票钱包、下单失败资金回滚、Jackpot 蓄水与非头奖结算、玩家端可见状态。
*/
use App\Lottery\DrawResultBatchStatus;
use App\Lottery\DrawStatus;
use App\Lottery\ErrorCode;
use App\Models\Draw;
use App\Models\DrawResultBatch;
use App\Models\DrawResultItem;
use App\Models\JackpotContribution;
use App\Models\JackpotPayoutLog;
use App\Models\JackpotPool;
use App\Models\Player;
use App\Models\PlayerWallet;
use App\Models\RiskPool;
use App\Models\TicketCombination;
use App\Models\TicketItem;
use App\Models\TicketOrder;
use App\Models\TicketSettlementDetail;
use App\Models\WalletTxn;
use App\Services\Draw\DrawPrizeLayout;
use App\Services\Settlement\SettlementOrchestrator;
use App\Lottery\ErrorCode;
use App\Models\TicketItem;
use App\Lottery\DrawStatus;
use App\Models\JackpotPool;
use App\Models\TicketOrder;
use App\Models\PlayerWallet;
use App\Models\DrawResultItem;
use App\Models\DrawResultBatch;
use App\Models\JackpotPayoutLog;
use App\Models\TicketCombination;
use App\Models\JackpotContribution;
use App\Support\OddsStandardScopes;
use Database\Seeders\CurrencySeeder;
use Database\Seeders\PlayTypeSeeder;
use App\Lottery\DrawResultBatchStatus;
use App\Models\TicketSettlementDetail;
use App\Services\Draw\DrawPrizeLayout;
use Database\Seeders\LotterySettingsSeeder;
use Database\Seeders\OperationalConfigV1Seeder;
use Database\Seeders\PlayTypeSeeder;
use Illuminate\Foundation\Testing\RefreshDatabase;
use App\Services\Settlement\SettlementOrchestrator;
uses(RefreshDatabase::class);

View File

@@ -1,22 +1,22 @@
<?php
use App\Lottery\ConfigVersionStatus;
use App\Lottery\DrawStatus;
use App\Lottery\ErrorCode;
use App\Models\Draw;
use App\Models\Player;
use App\Models\RiskPool;
use App\Models\WalletTxn;
use App\Lottery\ErrorCode;
use App\Models\TicketItem;
use App\Lottery\DrawStatus;
use App\Models\OddsVersion;
use App\Models\TicketOrder;
use App\Models\PlayerWallet;
use App\Models\PlayConfigItem;
use App\Models\PlayConfigVersion;
use App\Models\Player;
use App\Models\PlayerWallet;
use App\Models\RiskPool;
use App\Models\TicketItem;
use App\Models\TicketOrder;
use App\Models\WalletTxn;
use App\Lottery\ConfigVersionStatus;
use Database\Seeders\CurrencySeeder;
use Database\Seeders\PlayTypeSeeder;
use Database\Seeders\LotterySettingsSeeder;
use Database\Seeders\OperationalConfigV1Seeder;
use Database\Seeders\PlayTypeSeeder;
use Illuminate\Foundation\Testing\RefreshDatabase;
uses(RefreshDatabase::class);

View File

@@ -1,18 +1,18 @@
<?php
use App\Lottery\DrawResultBatchStatus;
use App\Lottery\DrawStatus;
use App\Models\Draw;
use App\Models\DrawResultBatch;
use App\Models\DrawResultItem;
use App\Models\JackpotPool;
use App\Models\Player;
use App\Lottery\DrawStatus;
use App\Models\JackpotPool;
use App\Models\PlayerWallet;
use App\Services\Draw\DrawPrizeLayout;
use App\Models\DrawResultItem;
use App\Models\DrawResultBatch;
use Database\Seeders\CurrencySeeder;
use Database\Seeders\PlayTypeSeeder;
use App\Lottery\DrawResultBatchStatus;
use App\Services\Draw\DrawPrizeLayout;
use Database\Seeders\LotterySettingsSeeder;
use Database\Seeders\OperationalConfigV1Seeder;
use Database\Seeders\PlayTypeSeeder;
use Illuminate\Foundation\Testing\RefreshDatabase;
uses(RefreshDatabase::class);

View File

@@ -1,7 +1,7 @@
<?php
use App\Lottery\ErrorCode;
use App\Models\Player;
use App\Lottery\ErrorCode;
use App\Models\PlayerWallet;
use Illuminate\Foundation\Testing\RefreshDatabase;

View File

@@ -1,13 +1,13 @@
<?php
use App\Lottery\ErrorCode;
use App\Models\Player;
use App\Models\PlayerWallet;
use App\Models\WalletTxn;
use App\Lottery\ErrorCode;
use App\Models\PlayerWallet;
use Database\Seeders\CurrencySeeder;
use Illuminate\Support\Facades\Http;
use Database\Seeders\LotterySettingsSeeder;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Http;
uses(RefreshDatabase::class);

View File

@@ -4,16 +4,16 @@
* 钱包划转场景:鉴权、幂等、转入/转出成功·失败·处理中(与 PRD / MainSiteWalletGateway 行为对齐)。
*/
use App\Lottery\ErrorCode;
use Firebase\JWT\JWT;
use App\Models\Player;
use App\Models\WalletTxn;
use App\Lottery\ErrorCode;
use App\Models\PlayerWallet;
use App\Models\TransferOrder;
use App\Models\WalletTxn;
use Database\Seeders\CurrencySeeder;
use Database\Seeders\LotterySettingsSeeder;
use Firebase\JWT\JWT;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Http;
use Database\Seeders\LotterySettingsSeeder;
use Illuminate\Foundation\Testing\RefreshDatabase;
uses(RefreshDatabase::class);

View File

@@ -1,15 +1,15 @@
<?php
use App\Lottery\ErrorCode;
use App\Models\Player;
use App\Models\WalletTxn;
use App\Lottery\ErrorCode;
use App\Models\PlayerWallet;
use App\Models\TransferOrder;
use App\Models\WalletTxn;
use App\Services\LotterySettings;
use Database\Seeders\CurrencySeeder;
use Illuminate\Support\Facades\Http;
use Database\Seeders\LotterySettingsSeeder;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Http;
uses(RefreshDatabase::class);

View File

@@ -1,9 +1,9 @@
<?php
use App\Models\AdminUser;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\DB;
use Tests\TestCase;
use App\Models\AdminUser;
use Illuminate\Support\Facades\DB;
use Illuminate\Foundation\Testing\RefreshDatabase;
/*
|--------------------------------------------------------------------------