<?php
/**
 * LOVE TALK CLUB - 前台入口
 */
require_once __DIR__ . '/config.php';

// 兜底推进开奖：任意前台访问都会结算到期期号，避免未配置计划任务时长期不开奖
try {
    Lottery::tick();
} catch (Throwable $e) {
    // 安装前或数据库异常时忽略，不影响页面正常访问
}

$router = new Router();
$router->map([
    ''                 => 'HomeController@index',
    'Home'             => 'HomeController@index',
    'IndexInfo'        => 'NoticeController@info',

    'Login'            => 'AuthController@loginPage',
    'Register'         => 'AuthController@registerPage',
    'Logout'           => 'AuthController@logout',
    'Language'         => 'PageController@language',

    'List'             => 'XuanfeiController@listPage',
    'Choose'           => 'XuanfeiController@listPage',
    'detail'           => 'XuanfeiController@detail',
    'Profile'          => 'XuanfeiController@detail',

    'Reviews'          => 'ReviewsController@index',

    'Video'            => 'VideoPageController@index',
    'PlayVideo'        => 'VideoPageController@play',

    'Lottery'          => 'LotteryController@index',
    'Game'             => 'LotteryController@index',
    'GameRecord'       => 'LotteryController@records',

    'Notice'           => 'NoticeController@index',

    'Mine'             => 'MineController@index',
    'Invite'           => 'MineController@invite',

    'Recharge'         => 'AccountController@recharge',
    'RechargeList'     => 'AccountController@rechargeList',
    'Withdraw'         => 'AccountController@withdraw',
    'WithdrawRecord'   => 'AccountController@withdrawRecord',
    'BindCard'         => 'AccountController@bank',
    'Setbank'          => 'AccountController@bank',

    'Setting'          => 'SettingController@index',
    'Setname'          => 'SettingController@setName',
    'Setsex'           => 'SettingController@setSex',
    'SetLoginPassword' => 'SettingController@setLoginPassword',
    'SetPayPassword'   => 'SettingController@setPayPassword',
    'Infomation'       => 'SettingController@information',
    'Personalreport'   => 'SettingController@personalReport',

    'ServiceOnline'    => 'ServiceController@online',
    'ServicePage'      => 'ServiceController@page',
]);

$router->dispatch();
