[API]新增接口/api/game/anteConfig获取底注配置

This commit is contained in:
2026-03-25 14:46:47 +08:00
parent ce9062e186
commit 9b4104fc0e
2 changed files with 16 additions and 0 deletions

View File

@@ -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: tokenTokenMiddleware 注入)
* 返回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

View File

@@ -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,