From 9b4104fc0e5b2fe41e621d30e2de6c891973eda4 Mon Sep 17 00:00:00 2001 From: zhenhui <1276357500@qq.com> Date: Wed, 25 Mar 2026 14:46:47 +0800 Subject: [PATCH] =?UTF-8?q?[API]=E6=96=B0=E5=A2=9E=E6=8E=A5=E5=8F=A3/api/g?= =?UTF-8?q?ame/anteConfig=E8=8E=B7=E5=8F=96=E5=BA=95=E6=B3=A8=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/app/api/controller/GameController.php | 15 +++++++++++++++ server/config/route.php | 1 + 2 files changed, 16 insertions(+) diff --git a/server/app/api/controller/GameController.php b/server/app/api/controller/GameController.php index 88c98d1..8701ffc 100644 --- a/server/app/api/controller/GameController.php +++ b/server/app/api/controller/GameController.php @@ -11,6 +11,7 @@ use app\api\logic\GameLogic; use app\api\logic\PlayStartLogic; use app\api\util\ReturnCode; use app\dice\model\config\DiceConfig; +use app\dice\model\ante_config\DiceAnteConfig; use app\dice\model\play_record\DicePlayRecord; use app\dice\model\player\DicePlayer; use app\dice\model\reward\DiceRewardConfig; @@ -134,6 +135,20 @@ class GameController extends BaseController return $this->success($list); } + /** + * 获取底注配置(全部) + * GET/any /api/game/anteConfig + * header: token(TokenMiddleware 注入) + * 返回:dice_ante_config 列表(包含 mult/is_default 等字段) + */ + public function anteConfig(Request $request): Response + { + // 用于后续抽奖校验:在接口中实例化 model,后续逻辑可复用相同的数据读取方式。 + $anteConfigModel = new DiceAnteConfig(); + $rows = $anteConfigModel->order('id', 'asc')->select()->toArray(); + return $this->success($rows); + } + /** * 开始游戏(抽奖一局) * POST /api/game/playStart diff --git a/server/config/route.php b/server/config/route.php index 7325e4a..081565f 100644 --- a/server/config/route.php +++ b/server/config/route.php @@ -48,6 +48,7 @@ Route::group('/api', function () { Route::any('/game/config', [app\api\controller\GameController::class, 'config']); Route::any('/game/buyLotteryTickets', [app\api\controller\GameController::class, 'buyLotteryTickets']); Route::any('/game/lotteryPool', [app\api\controller\GameController::class, 'lotteryPool']); + Route::any('/game/anteConfig', [app\api\controller\GameController::class, 'anteConfig']); Route::any('/game/playStart', [app\api\controller\GameController::class, 'playStart']); })->middleware([ TokenMiddleware::class,