<?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) {
    // test
    $api->get('test', [
        'as' => 'test',
        'uses' => 'AuthController@test',
    ]);
    // Auth
    // signin
    $api->post('auth/login', [
        'as' => 'auth.login',
        'uses' => 'AuthController@login',
    ]);
    $api->post('auth/logout', [
        'as' => 'auth.logout',
        'uses' => 'AuthController@logout',
    ]);
    $api->post('auth/code', [
        'as' => 'auth.code',
        'uses' => 'AuthController@getCode',
    ]);
    // signup
    $api->post('auth/register', [
        'as' => 'auth.register',
        'uses' => 'AuthController@register',
    ]);
    $api->post('auth/password', [
        'as' => 'auth.reset',
        'uses' => 'AuthController@setPassword',
    ]);
    $api->post('auth/check_password', [
        'as' => 'auth.check_password',
        'uses' => 'AuthController@check_password',
    ]);
    $api->post('auth/reset', [
        'as' => 'auth.reset',
        'uses' => 'AuthController@reset',
    ]);
    $api->get('auth/is_login', [
        'as' => 'auth.is_login',
        'uses' => 'AuthController@isLogin',
    ]);

    $api->get('home/getintroduction', [
        'as' => 'home.getintroduction',
        'uses' => 'HomeController@getIntroduction',
    ]);

    $api->get('home/getbasedata', [
        'as' => 'home.getbasedata',
        'uses' => 'HomeController@getBaseData',
    ]);

    $api->post('home/getqueried', [
        'as' => 'home.getqueried',
        'uses' => 'HomeController@getQueried',
    ]);

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

    $api->post('home/agreeintroduction', [
        'as' => 'home.agreeintroduction',
        'uses' => 'HomeController@agreeIntroduction',
    ]);

    $api->post('home/getpaidmajors', [
        'as' => 'home.getpaidmajors',
        'uses' => 'HomeController@getPaidMajors',
    ]);

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

    $api->any('home/notify', [
        'as' => 'home.notify',
        'uses' => 'HomeController@notify',
    ]);

    $api->post('home/getphonenumber', [
        'as' => 'home.getphoneNnumber',
        'uses' => 'HomeController@getPhoneNumber',
    ]);



});