<?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('index/hot', [
        'as' => 'index.hot',
        'uses' => 'IndexController@hot',
    ]);
    $api->get('index/trend', [
        'as' => 'index.trend',
        'uses' => 'IndexController@trend',
    ]);
    $api->get('index/new', [
        'as' => 'index.new',
        'uses' => 'IndexController@new',
    ]);
    $api->get('index/search', [
        'as' => 'index.search',
        'uses' => 'IndexController@search',
    ]);

//我的
    $api->get('my/index', [
        'as' => 'my.index',
        'uses' => 'MyController@index',
    ]);
    $api->get('my/persona', [
        'as' => 'my.persona',
        'uses' => 'MyController@persona',
    ]);
//    充值
    $api->get('my/recharge', [
        'as' => 'my.recharge',
        'uses' => 'MyController@recharge',
    ]);
    $api->get('my/system_info', [
        'as' => 'my.system_info',
        'uses' => 'MyController@systemInfo',
    ]);
    $api->get('my/reply_my', [
        'as' => 'my.reply_my',
        'uses' => 'MyController@replyMy',
    ]);
    $api->post('my/my_reply', [
        'as' => 'my.my_reply',
        'uses' => 'MyController@myReply',
    ]);
    $api->get('my/dream', [
        'as' => 'my.dream',
        'uses' => 'MyController@dream',
    ]);
//    我的收藏
    $api->get('my/collection', [
        'as' => 'my.collection',
        'uses' => 'MyController@collection',
    ]);
    $api->get('my/setting', [
        'as' => 'my.setting',
        'uses' => 'MyController@setting',
    ]);
    $api->post('my/add_dream', [
        'as' => 'my.add_dream',
        'uses' => 'MyController@addDream',
    ]);
    $api->get('my/dream_about', [
        'as' => 'my.dream_about',
        'uses' => 'MyController@dreamAbout',
    ]);

//    用户信息
    $api->get('user/index', [
        'as' => 'user.index',
        'uses' => 'HomeController@index',
    ]);
    $api->get('user/homepage', [
        'as' => 'user.homepage',
        'uses' => 'HomeController@homepage',
    ]);
    $api->post('user/support', [
        'as' => 'user.support',
        'uses' => 'HomeController@support',
    ]);
//    互动
    $api->get('user/interaction', [
        'as' => 'user.interaction',
        'uses' => 'HomeController@interaction',
    ]);

    $api->get('user/paihang', [
        'as' => 'user.paihang',
        'uses' => 'HomeController@paihang',
    ]);

});