<?php

use Illuminate\Routing\Router;
use Illuminate\Support\Facades\Route;
use Dcat\Admin\Admin;

Admin::routes();

Route::group([
    'prefix'     => config('admin.route.prefix'),
    'namespace'  => config('admin.route.namespace'),
    'middleware' => config('admin.route.middleware'),
], function (Router $router) {
    $router->get('/', 'HomeController@index');

    //  程序管理
    $router->group([
        'namespace' => 'Program',
        'prefix'    => 'program',
    ], function ($router) {
        // 程序管理 --banner
        $router->resource('/banner', 'BannerController');
        // 程序管理 --导航
        $router->resource('/navbar', 'NavBarController');
        // 程序管理 --标签
        $router->resource('/tabbar', 'TabbarController');
        // 程序管理 --首页栏目
        $router->resource('/home_column', 'HomeColumnController');
    });

    //  短剧管理
    $router->group([
        'namespace' => 'Episode',
        'prefix'    => 'episodes',
    ], function ($router) {
        // 短剧管理 --短剧列表
        /* @var Route $router */
        $router->resource('/index', 'EpisodeController');
        // 短剧管理 --短剧分类
        $router->resource('/category', 'EpisodesCategoryController');
        // 短剧批量上传
        $router->resource('/batch/{id}/upload', 'EpisodesBatchUploadController');
        // $router->put('batch', 'SettingController@setting');
    });
    // 短剧管理 --短剧列表
    $router->resource('episodes/{episodes}/lists', 'Episode\\EpisodesListController')->shallow();

    //  订单
    $router->group([
        'namespace' => 'Order',
        'prefix'    => 'order',
    ], function ($router) {
        // 订单管理 --金币消费记录
        // $router->resource('/consume','UserConsumeRecordController');
        // 订单管理 --充值记录
        $router->resource('/recharge', 'UserRechargeRecordController');
        // 订单管理 --用户短剧消费记录
        $router->resource('/episodes', 'UserEpisodesRecordController');
        // 消费记录
        $router->resource('/consume', 'UserConsumeRecordController');
    });

    // 用户列表
    $router->resource('/users', 'UserController');
    $router->resource('/PaymentConfig', 'PaymentConfigController');
    $router->resource('/order', 'OrderController');
    $router->resource('/withdraw', 'WithdrawController');
    // VIP购买记录
    $router->resource('/vip/records', 'UserVipRecordController');
    $router->resource('/Giveaway', 'GiveawayController');
    $router->resource('/Recommendations', 'RecommendationsController');
    $router->resource('/taskList', 'TaskListController');
    $router->resource('/banner', 'BannerController');
    $router->resource('/protocol', 'ProtocolController');
    $router->resource('/service', 'ServiceController');
    $router->resource('/promotion_background', 'PromotionController');
    $router->resource('/share', 'ShareController');
    $router->resource('/aiLvCount', 'AiCountController');
    $router->resource('/Other', 'OtherController');
    $router->resource('/apply', 'ApplyController');
    $router->resource('/ShareA', 'ShareAController');
    $router->resource('/shareList', 'ShareUserController');
    $router->resource('/Winnow', 'WinnowController');
    $router->resource('/keyword', 'KeywordController');
        $router->resource('/UsersRole', 'UsersRoleController');
            $router->resource('/ShareData', 'ShareDataController');
    //  营销
    $router->group([
        'namespace' => 'Market',
        'prefix'    => 'market',
    ], function ($router) {
        // --会员 充值套餐
        $router->resource('/member/combo', 'VipComboController');
        // --金币 充值设置
        $router->resource('/recharge/setting', 'RechargeComboController');
        // --金币 充值记录
        $router->resource('/recharge/records', 'UserRechargeRecordController');
    });
    // 营销 --会员 权限设置
    $router->resource('/market/member/role', 'Setting\\SettingController');
    // 营销 --金币 基础设置
    $router->resource('/market/setting/gold', 'Setting\\SettingController');
    // 营销 --签到
    $router->resource('/market/setting/sign', 'Setting\\SettingController');

    //  设置
    $router->group([
        'namespace' => 'Setting',
        'prefix'    => 'setting',
    ], function ($router) {
        // --基础设置
        $router->resource('/base/basic', 'SettingController');
        // --消息设置
        $router->resource('/base/tips', 'SettingController');
        // --订单设置
        $router->resource('/pay', 'PayConfigController');
        // --支付设置
        $router->resource('/pay', 'PayConfigController');
    });

    //  分销
    $router->group([
        'namespace' => 'Share',
        'prefix'    => 'share',
    ], function ($router) {
        // --设置
        $router->resource('/setting', 'ShareConfigController');
        $router->post('/setting/save', 'ShareConfigController@save');
        // --分销商
        $router->resource('/users', 'UserController');
        // --体现管理
        $router->resource('/withdraw', 'UserWithdrawController');
    });
});
