<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/

$router->get('/', function () use ($router) {
    return $router->app->version();
});

$router->get('/key', function () {
    return str_random(32);
});

//积分信息
$router->post('/integrals/list', 'IntegralsController@index');
$router->post('/integrals/info', 'IntegralsController@show');
$router->post('/integrals/add', 'IntegralsController@create');
$router->post('/integrals/update', 'IntegralsController@update');
$router->post('/integrals/delete', 'IntegralsController@destroy');
$router->post('/integrals/batchUpdateStatus', 'IntegralsController@batchUpdateStatus');


//积分类型
$router->post('/integral_types/list', 'IntegralTypesController@index');
$router->post('/integral_types/add', 'IntegralTypesController@create');
$router->post('/integral_types/update', 'IntegralTypesController@update');
$router->post('/integral_types/delete', 'IntegralTypesController@destroy');

//用户积分账单
$router->post('/integral_bills/list', 'IntegralBillsController@index');
$router->post('/integral_bills/add', 'IntegralBillsController@create');
$router->post('/integral_bills/update', 'IntegralBillsController@update');
$router->post('/integral_bills/delete', 'IntegralBillsController@destroy');

//用户积分信息
$router->post('/user_integrals/info', 'UserIntegralsController@show');
$router->post('/user_integrals/list', 'UserIntegralsController@index');
$router->post('/user_integrals/update', 'UserIntegralsController@update');
$router->post('/user_integrals/batchUpdateStatus', 'UserIntegralsController@batchUpdateStatus');
$router->post('/user_integrals/updateExchangedIntegral', 'UserIntegralsController@updateExchangedIntegral');
$router->post('/user_integrals/statistics', 'UserIntegralsController@statistics');



//兑换配置
$router->post('/exchange_settings/info', 'ExchangeSettingsController@show');
$router->post('/exchange_settings/list', 'ExchangeSettingsController@index');
$router->post('/exchange_settings/add', 'ExchangeSettingsController@store');
$router->post('/exchange_settings/update', 'ExchangeSettingsController@update');
$router->post('/exchange_settings/delete', 'ExchangeSettingsController@destroy');
$router->post('/exchange_settings/batchUpdateStatus', 'ExchangeSettingsController@batchUpdateStatus');

//用户兑换记录
$router->post('/user_exchanges/info', 'UserExchangesController@show');
$router->post('/user_exchanges/list', 'UserExchangesController@index');
$router->post('/user_exchanges/update', 'UserExchangesController@update');
$router->post('/user_exchanges/batchUpdateStatus', 'UserExchangesController@batchUpdateStatus');

//抢兑换名额
$router->post('/rob/exchange/quota',        'ExchangeController@create');