<?php

Route::get('/', function () {
    return "";
    // return redirect('/main');
});

// API
Route::group(['prefix' => 'api2021', 'namespace' => 'Web'], function () {
    // 申報系統(已廢棄)
    Route::get('/getinfo/{hash}', 'Api2021Controller@getinfo');
    Route::post('/saveimg/{hash}', 'Api2021Controller@saveimg');
    Route::post('/savedata/{hash}', 'Api2021Controller@savedata');
    // 小遊戲
    Route::get('/info/{lineId}', 'Api2021Controller@info');
    Route::post('/game/{lineId}', 'Api2021Controller@game');
    Route::post('/redeem/{lineId}/{gid}', 'Api2021Controller@redeem');
    Route::get('/test', 'Api2021Controller@test');
    // 類發票
    Route::get('/friendchk/{lineId}', 'Api2021Controller@friendchk');
    Route::get('/activities/{lineId}', 'Api2021Controller@activities');
    Route::post('/setdoc/{lineId}', 'Api2021Controller@setdoc');
    Route::post('/reqreceipt/{lineId}', 'Api2021Controller@reqreceipt');
    Route::get('/lstreceipt/{lineId}', 'Api2021Controller@lstreceipt');
    Route::post('/redeemreceipt/{lineId}/{rid}', 'Api2021Controller@redeemreceipt');
    Route::post('/getreceipt/{lineId}/{rid}', 'Api2021Controller@getreceipt');
    // 串門子
    Route::post('/tinfo/{lineId}', 'Api2021Controller@tinfo');
    Route::post('/tgame/{lineId}', 'Api2021Controller@tgame');
    Route::post('/tredeem/{lineId}', 'Api2021Controller@tredeem');
});

// 後台路由
Route::group(['middleware' => 'web', 'prefix' => 'backend'], function () {
    Route::auth();
    Route::group(['middleware' => 'auth', 'namespace' => 'Backend'], function () {
        // 後台相關的路由請設置在這裡，將包含權限驗證
        Route::get('/', ['as' => 'backend.index', 'uses' => 'IndexController@index']);
        // 登出
        Route::post('/logout', function () {
            Auth::logout();
            
            return redirect('/backend');
        });
        // System ManagementChange Password
        Route::get('/Password', 'PasswordController@index');
        Route::post('/Password', 'PasswordController@update');
        // System ManagementManage Groups
        Route::get('/Usergroups', 'UsergroupsController@index');
        Route::get('/Usergroups/create', 'UsergroupsController@create');
        Route::get('/Usergroups/edit/{id}', 'UsergroupsController@edit');
        Route::post('/Usergroups/store', 'UsergroupsController@store');
        Route::delete('/Usergroups/{id}', 'UsergroupsController@delete');
        // System ManagementManage Users
        Route::get('/Users', 'UsersController@index');
        Route::get('/Users/edit/{id}', 'UsersController@edit');
        Route::get('/Users/create', 'UsersController@create');
        Route::post('/Users/store', 'UsersController@store');
        Route::delete('/Users/{id}', 'UsersController@delete');
        // System ManagementManage Functions
        Route::get('/Funmenus', 'FunmenusController@index');
        Route::get('/Funmenus/create', 'FunmenusController@create');
        Route::get('/Funmenus/edit/{id}', 'FunmenusController@edit');
        Route::post('/Funmenus/store', 'FunmenusController@store');
        Route::delete('/Funmenus/delete/{id}', 'FunmenusController@delete');
        // System ManagementManage Functions Detail
        Route::get('/Funmenus/{menuid}', 'FunmenusDetailController@index');
        Route::get('/Funmenus/{menuid}/create', 'FunmenusDetailController@create');
        Route::get('/Funmenus/{menuid}/edit/{id}', 'FunmenusDetailController@edit');
        Route::post('/Funmenus/{menuid}/store', 'FunmenusDetailController@store');
        Route::delete('/Funmenus/{menuid}/delete/{id}', 'FunmenusDetailController@delete');
        
        // 申報系統(已廢棄)
        
        // 業務功能 > 活動列表
        Route::get('/dataManagement/eventManagement', 'DataManagement\EventManagementController@index');
        Route::get('/dataManagement/eventManagement/grid', 'DataManagement\EventManagementController@grid');
        Route::post('/dataManagement/eventManagement/archive', 'DataManagement\EventManagementController@archive');
        Route::post('/dataManagement/eventManagement/unarchive', 'DataManagement\EventManagementController@unarchive');
        Route::post('/dataManagement/eventManagement/clear', 'DataManagement\EventManagementController@clear');
        Route::get('/dataManagement/eventManagement/create', 'DataManagement\EventManagementController@create');
        Route::get('/dataManagement/eventManagement/edit/{id}', 'DataManagement\EventManagementController@edit');
        Route::post('/dataManagement/eventManagement/saveImg', 'DataManagement\EventManagementController@saveImg');
        Route::post('/dataManagement/eventManagement/store', 'DataManagement\EventManagementController@store');
        Route::get('/dataManagement/eventManagement/getItems/{eid}', 'DataManagement\EventManagementController@getItems');
        // 業務功能 > 收件總表
        Route::get('/dataManagement/submitManagement', 'DataManagement\SubmitManagementController@index');
        Route::get('/dataManagement/submitManagement/grid', 'DataManagement\SubmitManagementController@grid');
        Route::get('/dataManagement/submitManagement/getItems/{eid}', 'DataManagement\SubmitManagementController@getItems');
        Route::get('/dataManagement/submitManagement/getZip/{param}', 'DataManagement\SubmitManagementController@getZip');
        
        // 小遊戲
        
        // 小遊戲 > 回合管理
        Route::get('/dataManagement/roundManagement', 'DataManagement\RoundManagementController@index');
        Route::get('/dataManagement/roundManagement/grid', 'DataManagement\RoundManagementController@grid');
        Route::get('/dataManagement/roundManagement/create', 'DataManagement\RoundManagementController@create');
        Route::get('/dataManagement/roundManagement/edit/{id}', 'DataManagement\RoundManagementController@edit');
        Route::post('/dataManagement/roundManagement/store', 'DataManagement\RoundManagementController@store');
        // 小遊戲 > 遊戲機率管理
        Route::get('/dataManagement/gameManagement', 'DataManagement\GameManagementController@index');
        Route::get('/dataManagement/gameManagement/grid', 'DataManagement\GameManagementController@grid');
        Route::get('/dataManagement/gameManagement/create', 'DataManagement\GameManagementController@create');
        Route::get('/dataManagement/gameManagement/edit/{id}', 'DataManagement\GameManagementController@edit');
        Route::post('/dataManagement/gameManagement/store', 'DataManagement\GameManagementController@store');
        // 小遊戲 > 簽到贈點管理
        Route::get('/dataManagement/checkinManagement', 'DataManagement\CheckinManagementController@index');
        Route::get('/dataManagement/checkinManagement/grid', 'DataManagement\CheckinManagementController@grid');
        Route::get('/dataManagement/checkinManagement/create', 'DataManagement\CheckinManagementController@create');
        Route::get('/dataManagement/checkinManagement/edit/{id}', 'DataManagement\CheckinManagementController@edit');
        Route::post('/dataManagement/checkinManagement/store', 'DataManagement\CheckinManagementController@store');
        // 小遊戲 > 獎項管理
        Route::get('/dataManagement/goodManagement', 'DataManagement\GoodManagementController@index');
        Route::get('/dataManagement/goodManagement/grid', 'DataManagement\GoodManagementController@grid');
        Route::get('/dataManagement/goodManagement/create', 'DataManagement\GoodManagementController@create');
        Route::get('/dataManagement/goodManagement/edit/{id}', 'DataManagement\GoodManagementController@edit');
        Route::post('/dataManagement/goodManagement/store', 'DataManagement\GoodManagementController@store');
        // 小遊戲 > 玩家監控
        Route::get('/dataManagement/playerManagement', 'DataManagement\PlayerManagementController@index');
        Route::get('/dataManagement/playerManagement/grid', 'DataManagement\PlayerManagementController@grid');
        Route::post('/dataManagement/playerManagement/export', 'DataManagement\PlayerManagementController@export');
        Route::get('/dataManagement/playerManagement/gpclear', 'DataManagement\PlayerManagementController@gpclear');
        // 小遊戲 > 事件監控
        Route::get('/dataManagement/sessionManagement', 'DataManagement\SessionManagementController@index');
        Route::get('/dataManagement/sessionManagement/grid', 'DataManagement\SessionManagementController@grid');
        Route::post('/dataManagement/sessionManagement/export', 'DataManagement\SessionManagementController@export');
        // 小遊戲 > 系統紀錄
        Route::get('/dataManagement/syslogManagement', 'DataManagement\SyslogManagementController@index');
        Route::get('/dataManagement/syslogManagement/grid', 'DataManagement\SyslogManagementController@grid');
        Route::post('/dataManagement/syslogManagement/export', 'DataManagement\SyslogManagementController@export');
        // 小遊戲 > 遊戲參數審核
        Route::get('/dataManagement/auditManagement', 'DataManagement\AuditManagementController@index');
        Route::get('/dataManagement/auditManagement/grid/round', 'DataManagement\AuditManagementController@grid_round');
        Route::get('/dataManagement/auditManagement/grid/game', 'DataManagement\AuditManagementController@grid_game');
        Route::get('/dataManagement/auditManagement/grid/checkin', 'DataManagement\AuditManagementController@grid_checkin');
        Route::get('/dataManagement/auditManagement/grid/good', 'DataManagement\AuditManagementController@grid_good');
        Route::get('/dataManagement/auditManagement/round/{id}', 'DataManagement\AuditManagementController@pass_round');
        Route::get('/dataManagement/auditManagement/game/{id}', 'DataManagement\AuditManagementController@pass_game');
        Route::get('/dataManagement/auditManagement/checkin/{id}', 'DataManagement\AuditManagementController@pass_checkin');
        Route::get('/dataManagement/auditManagement/good/{id}', 'DataManagement\AuditManagementController@pass_good');
        
        // 類發票
        
        // 類發票 > 活動維護
        Route::get('/dataManagement/activityManagement', 'DataManagement\ActivityManagementController@index');
        Route::get('/dataManagement/activityManagement/grid', 'DataManagement\ActivityManagementController@grid');
        Route::get('/dataManagement/activityManagement/create', 'DataManagement\ActivityManagementController@create');
        Route::get('/dataManagement/activityManagement/edit/{id}', 'DataManagement\ActivityManagementController@edit');
        Route::post('/dataManagement/activityManagement/store', 'DataManagement\ActivityManagementController@store');
        Route::get('/dataManagement/activityManagement/draw/{id}', 'DataManagement\ActivityManagementController@draw');
        Route::get('/dataManagement/activityManagement/check/{id}', 'DataManagement\ActivityManagementController@check');
        Route::get('/dataManagement/activityManagement/get/{id}', 'DataManagement\ActivityManagementController@get');
        // 類發票 > 登記資料維護
        Route::get('/dataManagement/receiptManagement', 'DataManagement\ReceiptManagementController@index');
        Route::get('/dataManagement/receiptManagement/grid', 'DataManagement\ReceiptManagementController@grid');
        Route::post('/dataManagement/receiptManagement/export', 'DataManagement\ReceiptManagementController@export');
        Route::post('/dataManagement/receiptManagement/redeemDone', 'DataManagement\ReceiptManagementController@redeemDone');
        Route::post('/dataManagement/receiptManagement/redeemFail', 'DataManagement\ReceiptManagementController@redeemFail');
        // 類發票 > 系統紀錄
        Route::get('/dataManagement/syslogactManagement', 'DataManagement\SyslogactManagementController@index');
        Route::get('/dataManagement/syslogactManagement/grid', 'DataManagement\SyslogactManagementController@grid');
        Route::post('/dataManagement/syslogactManagement/export', 'DataManagement\SyslogactManagementController@export');
        // 設定 > 參數維護
        Route::get('/dataManagement/settingManagement', 'DataManagement\SettingManagementController@index');
        Route::get('/dataManagement/settingManagement/grid', 'DataManagement\SettingManagementController@grid');
        Route::get('/dataManagement/settingManagement/create', 'DataManagement\SettingManagementController@create');
        Route::get('/dataManagement/settingManagement/edit/{id}', 'DataManagement\SettingManagementController@edit');
        Route::post('/dataManagement/settingManagement/store', 'DataManagement\SettingManagementController@store');
        
        // 串門子
        
        // 串門子 > 回合管理
        Route::get('/dataManagement/troundManagement', 'DataManagement\TRoundManagementController@index');
        Route::get('/dataManagement/troundManagement/grid', 'DataManagement\TRoundManagementController@grid');
        Route::get('/dataManagement/troundManagement/create', 'DataManagement\TRoundManagementController@create');
        Route::get('/dataManagement/troundManagement/edit/{id}', 'DataManagement\TRoundManagementController@edit');
        Route::post('/dataManagement/troundManagement/store', 'DataManagement\TRoundManagementController@store');
        // 串門子 > 簽到贈點管理
        Route::get('/dataManagement/tcheckinManagement', 'DataManagement\TCheckinManagementController@index');
        Route::get('/dataManagement/tcheckinManagement/grid', 'DataManagement\TCheckinManagementController@grid');
        Route::get('/dataManagement/tcheckinManagement/create', 'DataManagement\TCheckinManagementController@create');
        Route::get('/dataManagement/tcheckinManagement/edit/{id}', 'DataManagement\TCheckinManagementController@edit');
        Route::post('/dataManagement/tcheckinManagement/store', 'DataManagement\TCheckinManagementController@store');
        // 串門子 > 獎項管理
        Route::get('/dataManagement/tgoodManagement', 'DataManagement\TGoodManagementController@index');
        Route::get('/dataManagement/tgoodManagement/grid', 'DataManagement\TGoodManagementController@grid');
        Route::get('/dataManagement/tgoodManagement/create', 'DataManagement\TGoodManagementController@create');
        Route::get('/dataManagement/tgoodManagement/edit/{id}', 'DataManagement\TGoodManagementController@edit');
        Route::post('/dataManagement/tgoodManagement/store', 'DataManagement\TGoodManagementController@store');
        // 串門子 > 玩家監控
        Route::get('/dataManagement/tplayerManagement', 'DataManagement\TPlayerManagementController@index');
        Route::get('/dataManagement/tplayerManagement/grid', 'DataManagement\TPlayerManagementController@grid');
        Route::post('/dataManagement/tplayerManagement/export', 'DataManagement\TPlayerManagementController@export');
        Route::get('/dataManagement/tplayerManagement/jggclear', 'DataManagement\TPlayerManagementController@jggclear');
        Route::get('/dataManagement/tplayerManagement/gpclear', 'DataManagement\TPlayerManagementController@gpclear');
        // 串門子 > 事件監控
        Route::get('/dataManagement/tsessionManagement', 'DataManagement\TSessionManagementController@index');
        Route::get('/dataManagement/tsessionManagement/grid', 'DataManagement\TSessionManagementController@grid');
        Route::post('/dataManagement/tsessionManagement/export', 'DataManagement\TSessionManagementController@export');
        // 串門子 > 系統紀錄
        Route::get('/dataManagement/syslogtManagement', 'DataManagement\SyslogtManagementController@index');
        Route::get('/dataManagement/syslogtManagement/grid', 'DataManagement\SyslogtManagementController@grid');
        Route::post('/dataManagement/syslogtManagement/export', 'DataManagement\SyslogtManagementController@export');
        // 串門子 > 遊戲參數審核
        Route::get('/dataManagement/tauditManagement', 'DataManagement\TAuditManagementController@index');
        Route::get('/dataManagement/tauditManagement/grid/tround', 'DataManagement\TAuditManagementController@grid_tround');
        Route::get('/dataManagement/tauditManagement/grid/tcheckin', 'DataManagement\TAuditManagementController@grid_tcheckin');
        Route::get('/dataManagement/tauditManagement/grid/tgood', 'DataManagement\TAuditManagementController@grid_tgood');
        Route::get('/dataManagement/tauditManagement/tround/{id}', 'DataManagement\TAuditManagementController@pass_tround');
        Route::get('/dataManagement/tauditManagement/tcheckin/{id}', 'DataManagement\TAuditManagementController@pass_tcheckin');
        Route::get('/dataManagement/tauditManagement/tgood/{id}', 'DataManagement\TAuditManagementController@pass_tgood');
        
    });
});