v0.1.0
This commit is contained in:
12
backend/api/resources/data/api.json
Normal file
12
backend/api/resources/data/api.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"version": "1.0.0",
|
||||
"routes": [
|
||||
{
|
||||
"alias": [
|
||||
"/",
|
||||
"/help"
|
||||
],
|
||||
"description": "API help"
|
||||
}
|
||||
]
|
||||
}
|
15
backend/api/resources/routes/api.php
Normal file
15
backend/api/resources/routes/api.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
use ProVM\Crypto\Common\Controller\API;
|
||||
|
||||
$folder = __DIR__ . DIRECTORY_SEPARATOR . 'api';
|
||||
if (file_exists($folder)) {
|
||||
$files = new DirectoryIterator($folder);
|
||||
foreach ($files as $file) {
|
||||
if ($file->getExtension() != 'php') {
|
||||
continue;
|
||||
}
|
||||
include_once $file->getRealPath();
|
||||
}
|
||||
}
|
||||
|
||||
$app->get('[/]', API::class);
|
13
backend/api/resources/routes/api/coins.php
Normal file
13
backend/api/resources/routes/api/coins.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
use ProVM\Crypto\Common\Controller\Coins;
|
||||
|
||||
$app->group('/coins', function($app) {
|
||||
$app->post('/add', [Coins::class, 'add']);
|
||||
$app->get('[/]', Coins::class);
|
||||
});
|
||||
|
||||
$app->group('/coin/{coin_id}', function($app) {
|
||||
$app->put('/edit', [Coins::class, 'edit']);
|
||||
$app->delete('/delete', [Coins::class, 'delete']);
|
||||
$app->get('[/]', [Coins::class, 'show']);
|
||||
});
|
13
backend/api/resources/routes/api/locations.php
Normal file
13
backend/api/resources/routes/api/locations.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
use ProVM\Crypto\Common\Controller\Locations;
|
||||
|
||||
$app->group('/locations', function($app) {
|
||||
$app->post('/add', [Locations::class, 'add']);
|
||||
$app->get('[/]', Locations::class);
|
||||
});
|
||||
|
||||
$app->group('/location/{location_id}', function($app) {
|
||||
$app->put('/edit', [Locations::class, 'edit']);
|
||||
$app->delete('/delete', [Locations::class, 'delete']);
|
||||
$app->get('[/]', [Locations::class, 'show']);
|
||||
});
|
7
backend/api/resources/routes/api/update.php
Normal file
7
backend/api/resources/routes/api/update.php
Normal file
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
use ProVM\Crypto\Common\Controller\Update;
|
||||
|
||||
$app->group('/update', function($app) {
|
||||
$app->get('/register/{type:[0,1]}/{coin_id:[\d+]}', [Update::class, 'register']);
|
||||
$app->get('[/]', Update::class);
|
||||
});
|
13
backend/api/resources/routes/api/wallets.php
Normal file
13
backend/api/resources/routes/api/wallets.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
use ProVM\Crypto\Common\Controller\Wallets;
|
||||
|
||||
$app->group('/wallets', function($app) {
|
||||
$app->post('/add', [Wallets::class, 'add']);
|
||||
$app->get('[/]', Wallets::class);
|
||||
});
|
||||
|
||||
$app->group('/wallet/{wallet_id}', function($app) {
|
||||
$app->put('/edit', [Wallets::class, 'edit']);
|
||||
$app->delete('/delete', [Wallets::class, 'delete']);
|
||||
$app->get('[/]', [Wallets::class, 'show']);
|
||||
});
|
Reference in New Issue
Block a user