<?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!
|
*/

//Route::middleware('auth:api')->get('/user', function (Request $request) {
//    return $request->user();
//});




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

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

    $api->post('attachment/upload', [
        'as' => 'attachment.upload',
        'uses' => 'AttachmentController@upload',
    ]);
    $api->post('home/login', [
        'as' => 'home.login',
        'uses' => 'HomeController@login',
    ]);

    $api->get('home/getproducts', [
        'as' => 'home.getProducts',
        'uses' => 'HomeController@getProducts',
    ]);
    $api->get('home/getproduct', [
        'as' => 'home.getProduct',
        'uses' => 'HomeController@getProduct',
    ]);
    $api->get('home/getstores', [
        'as' => 'home.getStores',
        'uses' => 'HomeController@getStores',
    ]);
    $api->get('home/getschedule', [
        'as' => 'home.getschedule',
        'uses' => 'HomeController@getSchedule',
    ]);
    $api->post('home/createorder', [
        'as' => 'home.createorder',
        'uses' => 'HomeController@createOrder',
    ]);
    $api->get('home/couponlist', [
        'as' => 'home.couponlist',
        'uses' => 'HomeController@couponList',
    ]);
    $api->get('home/mycoupon', [
        'as' => 'home.mycoupon',
        'uses' => 'HomeController@myCoupon',
    ]);
    $api->get('home/getcoupon', [
        'as' => 'home.getcoupon',
        'uses' => 'HomeController@getCoupon',
    ]);
    $api->get('home/usablecoupon', [
        'as' => 'home.usablecoupon',
        'uses' => 'HomeController@usableCoupon',
    ]);
    $api->get('home/refund', [
        'as' => 'home.refund',
        'uses' => 'HomeController@refund',
    ]);
    $api->get('home/myorders', [
        'as' => 'home.myorders',
        'uses' => 'HomeController@myOrders',
    ]);

    $api->get('home/orderdetail', [
        'as' => 'home.orderdetail',
        'uses' => 'HomeController@orderDetail',
    ]);
    $api->any('home/notify', [
        'as' => 'home.notify',
        'uses' => 'HomeController@notify',
    ]);
    $api->any('home/pay', [
        'as' => 'home.notify',
        'uses' => 'HomeController@pay',
    ]);
    $api->any('home/activecard', [
        'as' => 'home.activeCard',
        'uses' => 'HomeController@activeCard',
    ]);
    $api->post('home/createbusiness', [
        'as' => 'home.createBusiness',
        'uses' => 'HomeController@createBusiness',
    ]);



});