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

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

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

    $api->post('/user/login','LoginController@login');

    $api->group(['middleware' => 'jwt.auth'],function ($api){

        /*
         * 用户管理
         */
        $api->get('/admin/user_all','UserController@user_all');
        $api->post('/admin/user_update','UserController@user_update');
        $api->get('/admin/user_search','UserController@user_search');

        $api->get('/user/info','UserController@user_info');
        $api->post('/user/changepsw','UserController@update_password');


        $api->post('/setting/time','BasicController@season_time');
        $api->get('/setting/status','BasicController@status');
        $api->post('/setting/bannerset','BasicController@bannerset');
        $api->get('/setting/bannerlist','BasicController@bannerlist');

        /*
         * 礼品管理
         */
        $api->get('/gift/show_gift','GiftController@show_gift');
        $api->post('/gift/update_gift','GiftController@update_gift');
        $api->post('/gift/add_gift','GiftController@add_gift');
        $api->get('/gift/del_gift','GiftController@del_gift');

        /*
         * 数据统计
         */
        $api->get('/data/war_data','DataController@war_data');
        $api->get('/data/type_num','DataController@type_num');
        $api->get('/data/day_num','DataController@day_num');
        $api->get('/data/order_count','DataController@order_count');
        $api->get('/data/sales','DataController@sales');
        $api->get('/data/sales_all','DataController@sales_all');

        /*
         *发货管理
         */
        $api->get('/order/sended','OrderController@sended');
        $api->get('/order/exchange','OrderController@exchange');//重新兑换
        $api->get('/order/nosend','OrderController@nosend');
        $api->post('/order/send','OrderController@send');
        $api->get('/order/search','OrderController@search');
        $api->get('/order/per_search','OrderController@per_search');
        $api->post('/order/address_update','OrderController@update_address');

        /*
         * 用户主页
         */

        $api->get('/userindex/info','IndexController@user_info');
        $api->get('/userindex/sold','UserController@user_sold');
        $api->get('/userindex/address','IndexController@user_address');
        $api->get('/userindex/order','IndexController@user_order');

        /*
         * 角色管理
         */

        $api->post('/role/add','RoleController@add_role');
        $api->get('/role/del','RoleController@del_role');
        $api->post('/role/update','RoleController@update_role');
        $api->get('/role/all','RoleController@all_role');

        /*
         * admin_user管理
         */

        $api->post('/user/add','AdminuserController@add_user');
        $api->get('/user/del','AdminuserController@del_user');
        $api->post('/user/update','AdminuserController@update_user');
        $api->get('/user/all','AdminuserController@all_user');

        /*
         * 图片上传管理
         */
        $api->get('/upload/succ','UploadController@success_all');
        $api->get('/upload/fail','UploadController@fail_all');
        $api->get('/upload/search','UploadController@search');
        $api->post('/upload/adj_score','UploadController@change_inte');
        $api->post('/upload/judge','UploadController@judge');
        $api->get('/download/repeat','DownloadController@repeat');
        $api->get('/judge/record','UploadController@record');
        /*
         * 报名管理
         */

        $api->get('/signup/user_update','SignupController@user_update');
        $api->get('/signup/user_search','SignupController@user_search');
        $api->get('/signup/download','SignupController@down_excel');
        $api->get('/signup/user_all','SignupController@user_all');
        /*
         * 奖励金明细
         */
        $api->get('/bonus/all','BonusController@all');
        $api->get('/bonus/search','BonusController@search');
        $api->get('/bonus/download','BonusController@download_bonus');

        /*
         * 学分明细
         */
        $api->get('/score/all','IntegralController@all');
        $api->get('/score/search','IntegralController@search');
        $api->get('/score/change','IntegralController@change_inte');

        /*
         * 荣誉详情
         */
        $api->get('/glory/all','GloryController@all');
        $api->get('/glory/search','GloryController@search');

        /*
         * 人工审核
         */
        $api->post('/humanreview/revirew','HumanreviewController@review');

        $api->get('/download/excel_all','DownloadController@excel_all');
//        $api->get('/download/download_order','OrderController@download_order');
        /*
         * 下载excel
         */

        $api->get('/download/rank','DownloadController@excel_rank');
//        $api->get('/download/excel','DownloadController@excel_every');
        $api->get('/download/download_order','OrderController@download_order');
        $api->get('/download/download_per','OrderController@download_per');
        $api->get('/download/excel_week','DownloadController@one_week');
        /*
         * 战区
         */
        $api->get('/team/all','TeamController@team_all');
        $api->get('/team/list','TeamController@team_list');

        /*
         * 排行榜
         */
        $api->get('/ranking/user','RankController@user_rank');
        $api->get('/ranking/crown','RankController@crown_rank');
        $api->get('/ranking/search','RankController@rank_search');

        $api->get('/setting/repair','BasicController@repair');
        $api->post('/excel/insert_demo','BasicController@insert_demo');

        $api->post('/pay/refunds','BasicController@send');
        /*退款验证码*/
        $api->get('/pay/send_code','BasicController@verify');
        $api->post('/humanreview/upload_img','HumanreviewController@upload_img');
        $api->post('/humanreview/review','HumanreviewController@review');
        $api->get('/humanreview/get_info','HumanreviewController@get_info');

        $api->get('/war/update_name','AdminuserController@update_name');
        $api->get('/war/add_phone','AdminuserController@add_phone');


        $api->get('/data/data_count','DataController@data_count');
        $api->get('/data/season_sale','DataController@season_sale');
    });
    $api->get('/download/excel','DownloadController@excel_every');
    $api->get('/download/bonus','DownloadController@bonus');

//    $api->get('/order/sendeds','OrderController@sended');
//    $api->get('/order/sends','OrderController@nosend');

//    $api->get('/order/gift','GiftController@show_gift');


    $api->post('/order/upload_excel','OrderController@upload_excel');
    $api->get('/index','IndexController@index');
    $api->get('/indexs','IndexController@indexs');
    $api->get('/save/test','IndexController@save_test');
    $api->get('/save/show_all','IndexController@save_test_1');

    $api->get('/data/location','DataController@location');
    $api->get('/data/province','DataController@province');
    $api->get('/data/province_time','DataController@province_time');


    $api->get('/data/sale_location','DataController@sale_location');
    $api->get('/data/sale_province','DataController@sale_province');
    $api->get('/data/sale_province_time','DataController@sale_province_time');



    $api->get('/data/jude_head','DataController@juge_head');
    $api->get('/data/season_sale_data','DataController@sale_type');

//    $api->get('/juge','BasicController@jude');
//    $api->get('/download/excel_every','DownloadController@excel_every');
//

});