<?php

use Illuminate\Routing\Router;

Admin::routes();

Route::group([
    'prefix'     => config('admin.route.prefix'),
    'namespace'  => config('admin.route.namespace'),
    'middleware' => config('admin.route.middleware'),
], function (Router $router) {

    $router->get('/', 'HomeController@index')->name('admin.home');
    $router->get('test', 'TestController@index')->name('test.index');
    $router->get('test/coupon', 'TestController@coupon');
    $router->get('test/check_coupon_log', 'TestController@checkCouponLog');
    $router->get('petro', 'PetroController@index');

    $router->post('uploads/editor', 'UploadController@editor')->name('uploads.editor');

    /**
     * 账户管理
     */
    $router->get('accounts', 'Account\IndexController@index');
    $router->get('accounts/logs', 'Account\LogController@index');
    $router->resource('accounts/rules', 'Account\RuleController');
    /**
     * 用户管理
     */
    $router->get('user/parent', 'User\IndexController@getParent');
    $router->resource('users', 'User\IndexController');

    //身份管理
    $router->resource('identity', 'IdentityController');

    /**
     * api 日志
     */
    $router->resource('logs', 'Log\IndexController');
    $router->resource('coupons', 'Coupon\IndexController'); //平安卡券
    $router->resource('settle_coupons', 'Coupon\SettleCouponController'); //平安结算数据
    $router->resource('pa_coupons', 'Coupon\PaCouponController'); //平安未找到数据
    $router->resource('wos', 'Wo\IndexController');         //沃钱包业务

    /**
     * 财务管理
     */
    $router->resource('finances', 'Finance\IndexController');
    $router->resource('financelogs', 'Finance\LogController');

    $router->get('census/today', 'Finance\CensusController@today');
    $router->resource('census', 'Finance\CensusController');

    //省份地址
    $router->get('ajax/areas/children', 'Ajax\AreaController@children')->name('areas.children');

    //活动列表
    $router->resource('activities', 'Activity\IndexController');
    $router->resource('rules', 'Activity\RuleController');
    $router->resource('activitycoupons', 'Activity\CouponController');
    $router->resource('activitycouponlogs', 'Activity\LogController');

});
