[API]新增接口/api/game/anteConfig获取底注配置
This commit is contained in:
@@ -11,6 +11,7 @@ use app\api\logic\GameLogic;
|
|||||||
use app\api\logic\PlayStartLogic;
|
use app\api\logic\PlayStartLogic;
|
||||||
use app\api\util\ReturnCode;
|
use app\api\util\ReturnCode;
|
||||||
use app\dice\model\config\DiceConfig;
|
use app\dice\model\config\DiceConfig;
|
||||||
|
use app\dice\model\ante_config\DiceAnteConfig;
|
||||||
use app\dice\model\play_record\DicePlayRecord;
|
use app\dice\model\play_record\DicePlayRecord;
|
||||||
use app\dice\model\player\DicePlayer;
|
use app\dice\model\player\DicePlayer;
|
||||||
use app\dice\model\reward\DiceRewardConfig;
|
use app\dice\model\reward\DiceRewardConfig;
|
||||||
@@ -134,6 +135,20 @@ class GameController extends BaseController
|
|||||||
return $this->success($list);
|
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
|
* POST /api/game/playStart
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ Route::group('/api', function () {
|
|||||||
Route::any('/game/config', [app\api\controller\GameController::class, 'config']);
|
Route::any('/game/config', [app\api\controller\GameController::class, 'config']);
|
||||||
Route::any('/game/buyLotteryTickets', [app\api\controller\GameController::class, 'buyLotteryTickets']);
|
Route::any('/game/buyLotteryTickets', [app\api\controller\GameController::class, 'buyLotteryTickets']);
|
||||||
Route::any('/game/lotteryPool', [app\api\controller\GameController::class, 'lotteryPool']);
|
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']);
|
Route::any('/game/playStart', [app\api\controller\GameController::class, 'playStart']);
|
||||||
})->middleware([
|
})->middleware([
|
||||||
TokenMiddleware::class,
|
TokenMiddleware::class,
|
||||||
|
|||||||
Reference in New Issue
Block a user