This commit is contained in:
2021-06-28 23:15:13 -04:00
parent 0061a3d920
commit f4a8db56ff
93 changed files with 2422 additions and 0 deletions

View File

@ -0,0 +1,12 @@
{
"version": "1.0.0",
"routes": [
{
"alias": [
"/",
"/help"
],
"description": "API help"
}
]
}

View 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);

View 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']);
});

View 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']);
});

View 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);
});

View 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']);
});