<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/


Route::get('/', function () {
    return view('welcome');
});

//Auth::routes();

Route::post('/login', 'UserController@login');
Route::post('/logout', 'UserController@logout');

Route::post('/upload', 'CommonController@upload');


Route::middleware(['manage.token'])->group(function () {
    Route::delete('/product_order/{id}', 'ProductOrderController@delete')->where('id', '[0-9]+');

    Route::post('/maternity_matron_order/remark', 'MaternityMatronOrderController@remark');
    Route::post('/product_order/remark', 'ProductOrderController@remark');
    Route::post('/option_order/remark', 'OptionOrderController@remark');

    Route::post('/reward/price', 'RewardController@price');
    Route::get('/reward/price', 'RewardController@getPrice');
    Route::get('/classify/parent', 'ClassifyController@parent');

    Route::post('/product_classify/store', 'ProductClassifyController@store');
    Route::get('/product_classify', 'ProductClassifyController@list');

    Route::get('/product/home', 'ProductController@home');
    Route::post('/product/home', 'ProductController@setHome');
    Route::post('/classify/home', 'ClassifyController@setHome');
    Route::get('/classify/home', 'ClassifyController@home');

    Route::get('/products', 'ProductController@manage_list');

    Route::get('/classify/{id}', 'ClassifyController@get');
    Route::get('/{order_type}/comments', 'CommonController@type_comments');
    Route::post('/{order_type}/status', 'CommonController@status');
    Route::post('/{order_type}/price', 'CommonController@price');
    Route::get('/{order_type}/{id}', 'CommonController@get')->where('id', '[0-9]+');
    Route::delete('/{order_type}/{id}', 'CommonController@delete')->where('id', '[0-9]+');

    Route::get('/campaigns', 'CampaignController@list');


    Route::get('/house_clean_orders', 'HouseCleanOrderController@list');

    Route::get('/house_appliance_clean_orders', 'HouseApplianceCleanOrderController@list');

    Route::get('/housekeeper_orders', 'HousekeeperOrderController@list');

    Route::get('/maternity_matron_orders', 'MaternityMatronOrderController@list');

    Route::get('/product_orders', 'ProductOrderController@list');

    Route::get('/server_infos', 'ServerInfoController@list');

    Route::get('/classifies', 'ClassifyController@list2');

    Route::get('/option_orders', 'OptionOrderController@list');


    Route::post('/{order_type}/{order_id}/comment', 'CommonController@addComment');
    Route::post('/campaign/store', 'CampaignController@store');
    Route::post('/product/store', 'ProductController@store');
    Route::post('/classify/store', 'ClassifyController@store');
    Route::post('/house_clean_order/store', 'HouseCleanOrderController@store');
    Route::post('/house_appliance_clean_order/store', 'HouseApplianceCleanOrderController@store');
    Route::post('/housekeeper_order/store', 'HousekeeperOrderController@store');
    Route::post('/maternity_matron_order/store', 'MaternityMatronOrderController@store');
    Route::post('/product_order/store', 'ProductOrderController@store');
    Route::post('/server_info/store', 'ServerInfoController@store');

    Route::get('/introduce', 'HomePageController@introduce');
    Route::post('/introduce/store', 'HomePageController@store');
    Route::post('/bottom/store', 'HomePageController@bottom');
    Route::get('/bottom', 'HomePageController@getBottom');


});
