<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
/** @var TYPE_NAME $api */

$api = app('Dingo\Api\Routing\Router');

$api->version('v1',[
    'namespace'=>'App\Http\Controllers'
],function ($api) {

    $api->group(['prefix'=>'login'],function($api){
        $api->post('wx_login','LoginController@wxLogin');
        $api->get('getToken','LoginController@getToken');
    });
    $api->post('crypt/getCryptData', 'CryptController@getCryptData');
    $api->post('crypt/getCryptDataStore', 'CryptController@getCryptDataStore');

    $api->group(['middleware'=>'check_token'],function ($api){
        $api->group(['prefix'=>'login'], function ($api){
            $api->get('get_user_info','LoginController@getUserInfo');
            $api->post('send_sms','LoginController@sendSms');
            $api->post('edit_sms','LoginController@editSms');
            $api->post('merge_user','LoginController@mergeUser');
        });

        $api->group(['prefix'=>'store'], function ($api){
            $api->get('get_store_index','StoreController@getStoreIndex');
            $api->get('get_shop_car_num','StoreController@getShopCarNum');
            $api->post('add_store_comment','StoreController@addStoreComment');
        });

        $api->group(['prefix'=>'goods'], function ($api){
            $api->get('get_goods_info','GoodsController@getGoodsInfo');
            $api->get('get_address','GoodsController@getAddress');
            $api->get('get_shop_car','GoodsController@getShopCar');
            $api->post('add_shop_car','GoodsController@addShopCar');
            $api->post('destroy_shop_car','GoodsController@destroyShopCar');
            $api->post('destroy_shop_car_sku','GoodsController@destroyShopCarSku');
            $api->get('get_goods_infos','GoodsController@getGoodsInfos');
            $api->get('get_all_address','GoodsController@getAllAddress');
            $api->post('set_default_address','GoodsController@setDefaultAddress');
            $api->post('update_address','GoodsController@updateAddress');
            $api->post('destroy_address','GoodsController@destroyAddress');
            $api->post('add_address','GoodsController@addAddress');
            $api->post('checked_shop_car','GoodsController@checkedShopCar');
            $api->post('update_shop_car_num','GoodsController@updateShopCarNum');
        });

        $api->group(['prefix'=>'order'], function ($api){
            $api->get('get_order_index','OrderController@getOrderIndex');
            $api->post('tip_send','OrderController@tipSend');
            $api->post('submit_order_info','OrderController@submitOrderInfo');
            $api->post('CheckOrder','OrderController@CheckOrder');
            $api->post('cancel_order','OrderController@cancelOrder');
            $api->get('get_order_status_num','OrderController@getOrderStatusNum');
            $api->get('get_order_list','OrderController@getOrderList');
            $api->get('get_order_express','OrderController@getOrderExpress');
            $api->get('get_comment','OrderController@getComment');
            $api->post('sure_pick_up','OrderController@surePickUp');
            $api->get('get_sign_package','OrderController@getSignPackage');
            $api->get('discernAdress','OrderController@DealAddress');
            $api->get('get_order_no_info','OrderController@getOrderNoInfo');
            $api->post('edit_order_remark','OrderController@editOrderRemark');
            $api->get('get_refund_order_detail','OrderController@getRefundOrderDetail');
            $api->get('get_scan_order','OrderController@getScanOrder');
            $api->post('sure_one_self_take','OrderController@sureOneSelfTake');
            $api->get('get_address_info','OrderController@getAddressInfo');

        });
        $api->group(['prefix'=>'cancel'], function ($api){
            $api->get('get_cancel_order_list','CancelController@getCancelOrderList');
            $api->post('delete_origin_order','CancelController@deleteOriginOrder');
        });

        $api->group(['prefix'=>'refund'], function ($api){
            $api->get('get_all_refund_order','RefundController@getAllRefundOrder');
            $api->get('get_origin_order_info','RefundController@getOriginOrderInfo');
            $api->post('upload_refund_order_img','RefundController@uploadRefundOrderImg');
            $api->post('submit_refund_order','RefundController@submitRefundOrder');
            $api->post('cancel_refund_order','RefundController@cancelRefundOrder');
            $api->get('get_refund_order_detail','RefundController@getRefundOrderDetail');
        });
    });
});
