<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;

// 用户相关路由
Route::group('user', function () {
    Route::post('login', 'User/login');
    Route::post('logout', 'User/logout');
    Route::post('create_user', 'User/createUser');
    Route::get('list', 'User/list');
    Route::get('detail', 'User/detail');
    Route::post('update', 'User/update');
    Route::post('delete', 'User/delete');
})->middleware([\app\middleware\AuthMiddleware::class, \app\middleware\BehaviorLogMiddleware::class]);

// 角色相关路由
Route::group('user_role', function () {
    Route::get('list', 'UserRole/list');
    Route::get('detail', 'UserRole/detail');
    Route::post('create', 'UserRole/create');
    Route::post('update', 'UserRole/update');
    Route::post('delete', 'UserRole/delete');
})->middleware([\app\middleware\AuthMiddleware::class, \app\middleware\BehaviorLogMiddleware::class]);

// 菜单-权限相关路由
Route::group('menu', function () {
    Route::get('get_user_menus', 'Menu/getUserMenus');
    Route::get('get_all_permissions', 'Menu/getAllPermissions');
})->middleware([\app\middleware\AuthMiddleware::class, \app\middleware\BehaviorLogMiddleware::class]);

// 菜单-权限相关路由
Route::group('globals_config', function () {
    Route::get('info', 'GlobalsConfig/getConfigInfo');
})->middleware([\app\middleware\AuthMiddleware::class, \app\middleware\BehaviorLogMiddleware::class]);

// 玩家相关路由
Route::group('player', function () {
    Route::get('list', 'Player/list');
    Route::get('detail', 'Player/detail');
    Route::post('update_status', 'Player/updateStatus');
    Route::post('update_adjust_status', 'Player/updateAdjustStatus');
    Route::get('statistics', 'Player/statistics');
    Route::get('export', 'Player/export');
})->middleware([\app\middleware\AuthMiddleware::class, \app\middleware\BehaviorLogMiddleware::class]);

// 游戏相关路由
Route::group('game', function () {
    Route::get('list', 'Game/list');
    Route::get('get_games', 'Game/getGames');
    Route::get('detail', 'Game/detail');
    Route::post('update', 'Game/update');
    Route::post('update_status', 'Game/updateStatus');
    Route::get('statistics', 'Game/statistics');
    Route::get('get_platforms', 'Game/getPlatforms');
    Route::get('export', 'Game/export');
})->middleware([\app\middleware\AuthMiddleware::class, \app\middleware\BehaviorLogMiddleware::class]);

// 玩家点控
Route::group('player_control', function () {
    Route::post('update', 'PlayerControl/updatePlayerControl');
    Route::get('list', 'PlayerControl/getPlayerControlList');
    Route::post('cancel', 'PlayerControl/cancelPlayerControlInfo');
    Route::post('all_cancel', 'PlayerControl/cancelAllPlayerControlInfo');
})->middleware([\app\middleware\AuthMiddleware::class, \app\middleware\BehaviorLogMiddleware::class]);

// 自动调控配置
Route::group('auto_rtp', function () {
    Route::post('update', 'GameControlAutoRTPConfig/updateAutoRTPConfig');
    Route::post('status', 'GameControlAutoRTPConfig/updateAutoRTPStatus');
    Route::get('info', 'GameControlAutoRTPConfig/getAutoRTPConfigInfo');
})->middleware([\app\middleware\AuthMiddleware::class, \app\middleware\BehaviorLogMiddleware::class]);

// 养功功能 - 控制列表
Route::group('improve_user_rtp', function () {
    Route::post('update', 'GameImproveUserRtp/updateGameImproveUserRtp');
    Route::get('list', 'GameImproveUserRtp/getGameImproveUserList');
    Route::post('cancel', 'GameImproveUserRtp/cancelGameImproveUserRtp');
    Route::post('all_cancel', 'GameImproveUserRtp/cancelAllGameImproveUserRtp');

    Route::get('global/list', 'GameImproveRtpGlobal/getImproveRtpGlobalList');
    Route::post('global/update', 'GameImproveRtpGlobal/updateImproveRtpGlobalInfo');
    Route::post('global/status', 'GameImproveRtpGlobal/updateImproveRtpGlobalStatus');

})->middleware([\app\middleware\AuthMiddleware::class, \app\middleware\BehaviorLogMiddleware::class]);

// 登录日志相关路由
Route::group('login_log', function () {
    Route::get('list', 'LoginLog/list');
    Route::get('detail', 'LoginLog/detail');
    Route::get('statistics', 'LoginLog/statistics');
    Route::get('recent_logs', 'LoginLog/recentLogs');
    Route::get('export', 'LoginLog/export');
})->middleware([\app\middleware\AuthMiddleware::class, \app\middleware\BehaviorLogMiddleware::class]);

// 操作日志相关路由
Route::group('behavior_log', function () {
    Route::get('list', 'BehaviorLog/list');
    Route::get('detail', 'BehaviorLog/detail');
    Route::get('statistics', 'BehaviorLog/statistics');
    Route::get('recent_logs', 'BehaviorLog/recentLogs');
    Route::get('get_behavior_types', 'BehaviorLog/getBehaviorTypes');
    Route::get('export', 'BehaviorLog/export');
})->middleware([\app\middleware\AuthMiddleware::class, \app\middleware\BehaviorLogMiddleware::class]);

// 游戏记录相关路由
Route::group('game_record', function () {
    Route::get('list', 'GameRecord/list');
    Route::get('detail', 'GameRecord/detail');
    Route::get('statistics', 'GameRecord/statistics');
    Route::get('get_games', 'GameRecord/getGames');
    Route::get('get_play_methods', 'GameRecord/getPlayMethods');
    Route::get('layout', 'GameRecord/layout');
})->middleware([\app\middleware\AuthMiddleware::class, \app\middleware\BehaviorLogMiddleware::class]);

// 游戏订单相关路由
Route::group('game_order', function () {
    Route::get('list', 'GameOrder/list');
    Route::get('detail', 'GameOrder/detail');
    Route::get('statistics', 'GameOrder/statistics');
    Route::get('get_games', 'GameOrder/getGames');
    Route::get('get_order_reasons', 'GameOrder/getOrderReasons');
    Route::get('export', 'GameOrder/export');
})->middleware([\app\middleware\AuthMiddleware::class, \app\middleware\BehaviorLogMiddleware::class]);

// 转账记录相关路由
Route::group('transfer_log', function () {
    Route::get('list', 'TransferLog/list');
    Route::get('detail', 'TransferLog/detail');
    Route::get('statistics', 'TransferLog/statistics');
    Route::get('export', 'TransferLog/export');
})->middleware([\app\middleware\AuthMiddleware::class, \app\middleware\BehaviorLogMiddleware::class]);

// 商户数据统计相关路由
Route::group('merchant_statis', function () {
    // 商户数据
    Route::get('stage', 'MerchantStatis/Stage');
    // 商户每日数据
    Route::get('daily', 'MerchantStatis/Daily');
    // 商户历史数据
    Route::get('history', 'MerchantStatis/history');
})->middleware([\app\middleware\AuthMiddleware::class, \app\middleware\BehaviorLogMiddleware::class]);

// 游戏数据统计相关路由
Route::group('game_statis', function () {
    // 游戏每日数据
    Route::get('daily', 'GameStatis/Daily');
    // 游戏输赢汇总
    Route::get('summary', 'GameStatis/Summary');
    // 押注档位数据
    Route::get('bet_level', 'GameStatis/BetLevel');    
})->middleware([\app\middleware\AuthMiddleware::class, \app\middleware\BehaviorLogMiddleware::class]);

// 走势数据相关路由
Route::group('trend_statis', function () {
    // 输赢走势
    Route::get('win', 'TrendStatis/Win');
    // 返奖倍数走势
    Route::get('prize_multiple', 'TrendStatis/PrizeMultiple');
    // 商户每日走势
    Route::get('merchant_daily', 'TrendStatis/MerchantDaily');
})->middleware([\app\middleware\AuthMiddleware::class, \app\middleware\BehaviorLogMiddleware::class]);

// 排行榜相关路由
Route::group('rank_list', function () {
    // 赢钱榜
    Route::get('win_amount', 'RankList/WinAmount');
    // 输钱榜
    Route::get('lose_amount', 'RankList/LoseAmount');
    // 注单额榜
    Route::get('bet_amount', 'RankList/BetAmount');
})->middleware([\app\middleware\AuthMiddleware::class, \app\middleware\BehaviorLogMiddleware::class]);

// 概览相关路由
Route::group('overview', function () {
    // 仪表盘
    Route::get('dashboard', 'Overview/Dashboard');
    // 输钱榜
    Route::get('settlement_report', 'Overview/SettlementReport');
})->middleware([\app\middleware\AuthMiddleware::class, \app\middleware\BehaviorLogMiddleware::class]);
