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,