<?php

Route::group(
    [
        'middleware' => [
            \Edwin404\Base\Support\BaseMiddleware::class,
            \Edwin404\Admin\Http\Middleware\AdminWebAuth::class,
        ],
        'prefix' => 'module/manage',
        'namespace' => '\App\Modules',
    ],
    function () {

        // 用户
        Route::match(['get', 'post'], 'user_info/{id}', 'User\Manage\HomeController@info');

        // 奖品中心
        Route::match(['get', 'post'], 'prize_pool', 'PrizePool\Manage\HomeController@index');
        Route::match(['get', 'post'], 'prize_pool_prize', 'PrizePool\Manage\HomeController@prize');
        Route::match(['get', 'post'], 'prize_pool_prize_edit/{id?}', 'PrizePool\Manage\HomeController@prizeEdit');
        Route::match(['get', 'post'], 'prize_pool_prize_delete/{id}', 'PrizePool\Manage\HomeController@prizeDelete');
        Route::match(['get', 'post'], 'prize_pool_prize_view/{id}', 'PrizePool\Manage\HomeController@prizeView');
        Route::match(['get', 'post'], 'prize_pool_prize_code/{id}', 'PrizePool\Manage\HomeController@prizeCode');
        Route::match(['get', 'post'], 'prize_pool_prize_code_import/{id}', 'PrizePool\Manage\HomeController@prizeCodeImport');
        Route::match(['get', 'post'], 'prize_pool_prize_dialog', 'PrizePool\Manage\HomeController@prizeDialog');
        Route::match(['get', 'post'], 'prize_pool_drawn', 'PrizePool\Manage\HomeController@drawn');
        Route::match(['get', 'post'], 'prize_pool_drawn_check/{id}', 'PrizePool\Manage\HomeController@drawnCheck');
        Route::match(['get', 'post'], 'prize_pool_drawn_shipped/{id}', 'PrizePool\Manage\HomeController@drawnShipped');
        Route::match(['get', 'post'], 'prize_pool_setting', 'PrizePool\Manage\HomeController@setting');

        // 刮刮卡
        Route::match(['get', 'post'], 'scratch', 'Scratch\Manage\HomeController@index');
        Route::match(['get', 'post'], 'scratch_activity/{id}', 'Scratch\Manage\HomeController@activity');
        Route::match(['get', 'post'], 'scratch_activity_edit/{id?}', 'Scratch\Manage\HomeController@activityEdit');
        Route::match(['get', 'post'], 'scratch_activity_delete/{id}', 'Scratch\Manage\HomeController@activityDelete');
        Route::match(['get', 'post'], 'scratch_drawn/{id}', 'Scratch\Manage\HomeController@drawn');

    }
);

Route::group(
    [
        'middleware' => [
            \Edwin404\Base\Support\BaseMiddleware::class,
            \App\Http\Middleware\MemberAuth::class,
        ],
        'prefix' => 'm',
        'namespace' => '\App\Modules',
    ],
    function () {

        // 用户授权
        Route::match(['get', 'post'], 'user_oauth_{oauthType}_login', 'User\Mobile\OauthController@login');
        Route::match(['get', 'post'], 'user_oauth_{oauthType}_callback', 'User\Mobile\OauthController@callback');

        // 用户
        Route::match(['get', 'post'], 'user_money_{alias}', 'User\Mobile\MoneyController@index')->where(['alias' => '[a-z0-9]+']);
        Route::match(['get', 'post'], 'user_money_{alias}_cash', 'User\Mobile\MoneyController@cash')->where(['alias' => '[a-z0-9]+']);
        Route::match(['get', 'post'], 'user_credit_{alias}', 'User\Mobile\CreditController@index')->where(['alias' => '[a-z0-9]+']);

        // 礼品中心
        Route::match(['get', 'post'], 'prize_pool_{alias}_activity_{activityType}_{activityAlias}', 'PrizePool\Mobile\HomeController@activity')->where(['alias' => '[a-z0-9]+']);
        Route::match(['get', 'post'], 'prize_pool_{alias}_users_{activityType}_{activityAlias}', 'PrizePool\Mobile\HomeController@users')->where(['alias' => '[a-z0-9]+']);
        Route::match(['get', 'post'], 'prize_pool_{alias}_fill_{drawnId}', 'PrizePool\Mobile\HomeController@fill')->where(['alias' => '[a-z0-9]+']);

        // 刮刮卡
        Route::match(['get'], 'scratch_{alias}', 'Scratch\Mobile\HomeController@home')->where(['alias' => '[a-z0-9]+']);
        Route::match(['post'], 'scratch_{alias}_draw', 'Scratch\Mobile\HomeController@draw')->where(['alias' => '[a-z0-9]+']);

    }
);

