150 lines
5.2 KiB
PHP
150 lines
5.2 KiB
PHP
<?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.
|
|
|
|
|
*/
|
|
|
|
$app->middleware([
|
|
Barryvdh\Cors\HandleCors::class,
|
|
]);
|
|
|
|
|
|
/** SWGGER DOCUMENTATION */
|
|
$app->get('/documentation', 'GeneratorController@index');
|
|
|
|
|
|
$app->post('/signup', 'AuthController@signup');
|
|
$app->post('/signout', 'AuthController@signout');
|
|
$app->post('/recover', 'AuthController@recover');
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| CMS
|
|
|--------------------------------------------------------------------------
|
|
*/
|
|
$app->get('/cms', 'CmsController@lists');
|
|
$app->get('/cms/{id_cms}', 'CmsController@get');
|
|
$app->get('/countries', 'CountryController@lists');
|
|
|
|
$app->group(['middleware' => 'auth'], function() use ($app) {
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| AUTH ROUTES
|
|
|--------------------------------------------------------------------------
|
|
*/
|
|
$app->post('/signin', 'AuthController@signin');
|
|
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| SALE ROUTES
|
|
|--------------------------------------------------------------------------
|
|
*/
|
|
$app->get('/sales', 'SaleController@lists');
|
|
$app->get('/tags', 'TagController@lists');
|
|
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| CATEGORY ROUTES
|
|
|--------------------------------------------------------------------------
|
|
*/
|
|
$app->get('/category/{id_category}', 'CategoryController@get');
|
|
$app->get('/category/{id_category}/products', 'CategoryController@list_products');
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| PRODUCT ROUTES
|
|
|--------------------------------------------------------------------------
|
|
*/
|
|
$app->get('/product/{id_product}', 'ProductController@get');
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| CART ROUTES
|
|
|--------------------------------------------------------------------------
|
|
*/
|
|
$app->get('/cart', 'CartController@get');
|
|
|
|
/* CART CARRIERS */
|
|
$app->get('/cart/carriers', 'CartController@getCarriers');
|
|
$app->put('/cart/carrier', 'CartController@setCarrier');
|
|
|
|
/* CART PRODUCTS */
|
|
$app->put('/cart/product', 'CartController@addProduct');
|
|
$app->delete('/cart/product', 'CartController@removeProduct');
|
|
|
|
|
|
/* CART DISCOUNTS */
|
|
$app->put('/cart/discount', 'CartController@addDiscount');
|
|
$app->get('/cart/discounts', 'CartController@getAvailableDiscounts');
|
|
$app->delete('/cart/discount', 'CartController@removeDiscount');
|
|
|
|
/* CART ADDRESS */
|
|
$app->put('/cart/address', 'CartController@setAddress');
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| PAYMENT ROUTES
|
|
|--------------------------------------------------------------------------
|
|
*/
|
|
$app->post('/payment/cheque', 'Payments\\ChequeController@execPayment');
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| CONTACT ROUTES
|
|
|--------------------------------------------------------------------------
|
|
*/
|
|
$app->get('/contacts', 'ContactController@lists');
|
|
$app->post('/contact', 'ContactController@create');
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| SPONSOR
|
|
|--------------------------------------------------------------------------
|
|
*/
|
|
$app->get('/sponsors', 'SponsorController@lists');
|
|
$app->post('/sponsors', 'SponsorController@invite');
|
|
$app->post('/sponsor/{id_invite}/revive', 'SponsorController@revive');
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| RELAYS
|
|
|--------------------------------------------------------------------------
|
|
*/
|
|
$app->get('/relays/socolissimo/{type:office|pickup}', 'Relays\\SocolissimoController@lists');
|
|
$app->put('/relays/socolissimo/{type:office|pickup}/address', 'Relays\\SocolissimoController@setAddressRelay');
|
|
|
|
$app->get('/relays/mondialrelay', 'Relays\\MondialRelayController@lists');
|
|
$app->put('/relays/mondialrelay/address', 'Relays\\MondialRelayController@setAddressRelay');
|
|
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| USER ROUTES
|
|
|--------------------------------------------------------------------------
|
|
*/
|
|
$app->get('/user', 'UserController@get');
|
|
$app->put('/user', 'UserController@update');
|
|
$app->put('/user/newsletter', 'UserController@updateNewsletter');
|
|
|
|
$app->get('/user/discounts', 'DiscountController@lists');
|
|
$app->get('/user/discount/{id_discount}', 'DiscountController@get');
|
|
|
|
$app->get('/user/orders', 'OrderController@lists');
|
|
$app->get('/user/refunds', 'OrderController@list_refunds');
|
|
$app->get('/user/order/{id_order}', 'OrderController@get');
|
|
|
|
$app->get('/user/addresses', 'AddressController@lists');
|
|
$app->get('/user/address/{id_address}', 'AddressController@get');
|
|
$app->put('/user/address/{id_address}', 'AddressController@update');
|
|
$app->post('/user/address', 'AddressController@create');
|
|
$app->delete('/user/address/{id_address}', 'AddressController@delete');
|
|
}); |