2019-11-14 22:18:57 +00:00
|
|
|
<?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) {
|
2019-12-01 17:30:25 +00:00
|
|
|
return json_encode(array(
|
|
|
|
"framework_version" =>$router->app->version(),
|
|
|
|
"api_min_version"=>"1.0",
|
|
|
|
"api_max_version"=>"1.0",
|
|
|
|
));
|
2019-11-14 22:18:57 +00:00
|
|
|
});
|
2019-11-15 20:59:47 +00:00
|
|
|
|
2019-12-01 17:30:25 +00:00
|
|
|
|
|
|
|
//API version 1
|
|
|
|
// copy this block and bump up version when implementing breaking changes
|
2019-11-30 23:50:52 +00:00
|
|
|
$router->group(['prefix' => '1'], function () use ($router) {
|
2019-11-15 21:15:58 +00:00
|
|
|
|
2019-12-01 17:30:25 +00:00
|
|
|
// events
|
2019-11-30 23:50:52 +00:00
|
|
|
$router->get('events', ['uses' => 'EventController@showAllEvents']);
|
|
|
|
$router->get('event/{id}', ['uses' => 'EventController@showOneEvent']);
|
|
|
|
$router->post('event', ['uses' => 'EventController@create']);
|
|
|
|
$router->delete('event/{id}', ['uses' => 'EventController@delete']);
|
|
|
|
$router->put('event/{id}', ['uses' => 'EventController@update']);
|
2019-11-15 21:26:54 +00:00
|
|
|
|
2019-12-01 17:30:25 +00:00
|
|
|
// containers
|
2019-11-30 23:50:52 +00:00
|
|
|
$router->get('boxes', ['uses' => 'ContainerController@showAllContainers']);
|
|
|
|
$router->get('box/{id}', ['uses' => 'ContainerController@showOneContainer']);
|
|
|
|
$router->post('box', ['uses' => 'ContainerController@create']);
|
|
|
|
$router->delete('box/{id}', ['uses' => 'ContainerController@delete']);
|
|
|
|
$router->put('box/{id}', ['uses' => 'ContainerController@update']);
|
2019-11-30 12:47:54 +00:00
|
|
|
|
2019-12-01 17:30:25 +00:00
|
|
|
// items
|
|
|
|
$router->get('{event}/items', ['uses' => 'ItemController@showByEvent']);
|
|
|
|
$router->get('{event}/items/{query}', ['uses' => 'ItemController@searchByEvent']);
|
2019-11-30 23:50:52 +00:00
|
|
|
$router->get('{event}/item/{id}', ['uses' => 'ItemController@showOneItem']);
|
|
|
|
$router->post('{event}/item', ['uses' => 'ItemController@create']);
|
|
|
|
$router->delete('{event}/item/{id}', ['uses' => 'ItemController@delete']);
|
|
|
|
$router->put('{event}/item/{id}', ['uses' => 'ItemController@update']);
|
2019-11-30 12:47:54 +00:00
|
|
|
});
|