<?php

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

Route::group([
    'prefix'    => 'mall',
    'namespace' => 'Admin',
    'as'        => 'mall.',
], function (Router $router) {
    $router->get('dashboard', 'DashboardController@index');
    /**
     * 版本记录
     */
    $router->get('versions/{model}/{key}', 'VersionController@index')->name('versions');
    /**
     * 店铺管理
     */
    $router->get('shops/ajax', 'ShopController@ajax')->name('shops.ajax');
    $router->resource('shops', 'ShopController');
    $router->resource('shops.staffers', 'StafferController');
    $router->resource('jobs', 'JobController');
    /**
     * 订单管理
     */
    $router->resource('orders', 'OrderController')->only(['index', 'show', 'create', 'store']);
    $router->resource('stock_orders', 'StockOrderController')->only(['index', 'show']);
    $router->resource('stock_orders_by_system', 'StockOrderBySystemController')->only([
        'index', 'show', 'create', 'store'
    ]);
    $router->resource('refunds', 'RefundController')->only(['index', 'show']);
    /**
     * 商品分类，品牌
     */
    $router->get('categories/ajax', 'CategoryController@ajax')->name('categories.ajax');
    $router->resource('categories', 'CategoryController');
    $router->get('brands/ajax', 'BrandController@ajax')->name('brands.ajax');
    $router->resource('brands', 'BrandController');
    $router->get('tags/ajax', 'TagController@ajax')->name('tags.ajax');
    $router->resource('tags', 'TagController');
    /**
     * 商品管理
     */
    $router->get('goods/{goods}/multiple', 'SkuMultipleController@index');
    $router->post('goods/{goods}/multiple', 'SkuMultipleController@store');
    $router->resource('goods', 'GoodsController');
    $router->resource('goods.skus', 'SkuController');
    $router->resource('goods.specs', 'SpecController');
    $router->resource('goods.specs.values', 'SpecValueController');
    /**
     * 物流管理
     */
    $router->resource('expresses', 'ExpressController');
    /**
     * 运费模板
     */
    $router->get('deliveries/ajax', 'DeliveryController@ajax')->name('deliveries.ajax');
    $router->resource('deliveries', 'DeliveryController');
    $router->resource('deliveries.rules', 'DeliveryRuleController');
    /**
     * 地域组件
     */
    $router->get('regions/ajax', 'RegionController@ajax')->name('regions.ajax');
    $router->get('regions/getRegion', 'RegionController@region')->name('regions.region');
    /**
     * 商城轮播图
     */
    $router->resource('banners', 'BannerController');

    /**
     * 退款/货原因
     */
    $router->resource('reasons', 'ReasonController');

    /**
     * 收货地址
     */
    $router->get('ajax/address', 'AjaxController@address')->name('ajax.address');
    $router->get('ajax/goods', 'AjaxController@goods')->name('ajax.goods');
    $router->resource('addresses', 'AddressController');
    $router->resource('activities', 'ActivityController');
    /**
     * 视频管理
     */
    $router->resource('videos', 'VideoController');

});
