<?php
use Illuminate\Routing\Router;

Admin::registerAuthRoutes ();

Route::group ( [ 
		'prefix' => config ( 'admin.route.prefix' ),
		'namespace' => config ( 'admin.route.namespace' ),
		'middleware' => config ( 'admin.route.middleware' )
], function (Router $router) {

	// 客服建议列表
	$router->get ( 'suggestion', 'SuggestionController@index' );
	$router->get ( 'suggestion/create', 'SuggestionController@create' );
	$router->post ( 'suggestion', 'SuggestionController@store' );
	$router->get ( 'suggestion/{id}/edit', 'SuggestionController@edit' );
	$router->put ( 'suggestion/{id}', 'SuggestionController@update' );

	$router->get ( '/', 'HomeController@index' );

	$router->get ( 'users', 'UsersController@index' );

	$router->get ( 'products', 'ProductsController@index' );
	$router->get ( 'products/create', 'ProductsController@create' );
	$router->post ( 'products', 'ProductsController@store' );
	$router->get ( 'products/{id}/edit', 'ProductsController@edit' );
	$router->put ( 'products/{id}', 'ProductsController@update' );
	$router->delete ( 'products/{id}', 'ProductsController@destroy' );
	

	$router->get ( 'orders', 'OrdersController@index' )->name ( 'admin.orders.index' );
	$router->get ( 'orders/{order}', 'OrdersController@show' )->name ( 'admin.orders.show' );
	$router->post ( 'orders/{order}/ship', 'OrdersController@ship' )->name ( 'admin.orders.ship' );
	$router->post ( 'orders/{order}/refund', 'OrdersController@handleRefund' )->name ( 'admin.orders.handle_refund' );

	$router->get ( 'coupon_codes', 'CouponCodesController@index' );
	$router->post ( 'coupon_codes', 'CouponCodesController@store' );
	$router->get ( 'coupon_codes/create', 'CouponCodesController@create' );
	$router->get ( 'coupon_codes/{id}/edit', 'CouponCodesController@edit' );
	$router->put ( 'coupon_codes/{id}', 'CouponCodesController@update' );
	$router->delete ( 'coupon_codes/{id}', 'CouponCodesController@destroy' );

	$router->get ( 'categories', 'CategoriesController@index' );
	$router->get ( 'categories/create', 'CategoriesController@create' );
	$router->get ( 'categories/{id}/edit', 'CategoriesController@edit' );
	$router->post ( 'categories', 'CategoriesController@store' );
	$router->put ( 'categories/{id}', 'CategoriesController@update' );
	$router->delete ( 'categories/{id}', 'CategoriesController@destroy' );
	$router->get ( 'api/categories', 'CategoriesController@apiIndex' );

	$router->get ( 'crowdfunding_products', 'CrowdfundingProductsController@index' );
	$router->get ( 'crowdfunding_products/create', 'CrowdfundingProductsController@create' );
	$router->post ( 'crowdfunding_products', 'CrowdfundingProductsController@store' );
	$router->get ( 'crowdfunding_products/{id}/edit', 'CrowdfundingProductsController@edit' );
	$router->put ( 'crowdfunding_products/{id}', 'CrowdfundingProductsController@update' );

	$router->get ( 'seckill_products', 'SeckillProductsController@index' );
	$router->get ( 'seckill_products/create', 'SeckillProductsController@create' );
	$router->post ( 'seckill_products', 'SeckillProductsController@store' );
	$router->get ( 'seckill_products/{id}/edit', 'SeckillProductsController@edit' );
	$router->put ( 'seckill_products/{id}', 'SeckillProductsController@update' );

	// 活动管理
	$router->get ( 'activity', 'ActivityController@index' );
	$router->get ( 'activity/create', 'ActivityController@create' );
	$router->post ( 'activity', 'ActivityController@store' );
	$router->get ( 'activity/{id}/edit', 'ActivityController@edit' );
	$router->get ( 'activity/{id}', 'ActivityController@show' );
	$router->put ( 'activity/{id}', 'ActivityController@update' );
	$router->delete ( 'activity/{id}', 'ActivityController@destroy' );

	$router->get ( 'activity_excel', 'ActivityController@excel' );
	$router->post ( 'activity_upload_excel', 'ActivityController@uploadExcel' );
	$router->get ( 'activity_change_status', 'ActivityController@changeStatus' );

	// 商品管理
	$router->get ( 'goods', 'GoodsController@index' );
	$router->get ( 'goods/create', 'GoodsController@create' );
	$router->post ( 'goods', 'GoodsController@store' );
	$router->get ( 'goods/{id}/edit', 'GoodsController@edit' );
	$router->get ( 'goods/{id}', 'GoodsController@show' );
	$router->put ( 'goods/{id}', 'GoodsController@update' );
	$router->delete ( 'goods/{id}', 'GoodsController@destroy' );

	// Banner管理
	$router->get ( 'banners', 'BannersController@index' );
	$router->get ( 'banners/create', 'BannersController@create' );
	$router->post ( 'banners', 'BannersController@store' );
	$router->get ( 'banners/{id}/edit', 'BannersController@edit' );
	$router->put ( 'banners/{id}', 'BannersController@update' );
	$router->delete ( 'banners/{id}', 'BannersController@destroy' );
	$router->get ( 'banner_change_status', 'BannersController@changeStatus' );

	$router->get ( 'cut', 'CutController@index' );
	$router->get ( 'cut/create', 'CutController@create' );
	$router->post ( 'cut', 'CutController@store' );
	$router->get ( 'cut/{id}/edit', 'CutController@edit' );
	$router->put ( 'cut/{id}', 'CutController@update' );
	
	// 医生管理
	$router->get ( 'doctors', 'DoctorsController@index' );
	$router->get ( 'doctors/create', 'DoctorsController@create' );
	$router->post ( 'doctors', 'DoctorsController@store' );
	$router->get ( 'doctors/{id}/edit', 'DoctorsController@edit' );
	$router->put ( 'doctors/{id}', 'DoctorsController@update' );
	$router->delete ( 'doctors/{id}', 'DoctorsController@destroy' );
	$router->get ( 'doctors_change_status', 'DoctorsController@changeStatus' );
	$router->any ( 'doctors/lists', 'DoctorsController@lists' ); //下拉列表用
	
	// 文章管理
	$router->get ( 'article', 'ArticleController@index' );
	$router->get ( 'article/create', 'ArticleController@create' );
	$router->post ( 'article', 'ArticleController@store' );
	$router->get ( 'article/{id}/edit', 'ArticleController@edit' );
	$router->put ( 'article/{id}', 'ArticleController@update' );
	$router->delete ( 'article/{id}', 'ArticleController@destroy' );

} );
