Files
crypto/backend/api/common/Controller/API.php
2021-06-28 23:15:13 -04:00

47 lines
1.2 KiB
PHP

<?php
namespace ProVM\Crypto\Common\Controller;
use Psr\Http\Message\ServerRequestInterface as Request;
use Psr\Http\Message\ResponseInterface as Response;
use ProVM\Common\Define\Controller\JSON;
class API {
use JSON;
public function __invoke(Request $request, Response $response): Response {
$output = [
'version' => '1.0.0',
'routes' => [
'/coins' => [
'/' => 'List all coins',
'/add' => 'Add coin'
],
'/coin/{coin_id}' => [
'/' => 'Show coin information',
'/edit' => 'Edit coin',
'/delete' => 'Delete coin'
],
'/locations' => [
'/' => 'List all locations',
'/add' => 'Add location'
],
'/location/{location_id}' => [
'/' => 'Show location information',
'/edit' => 'Edit location',
'/delete' => 'Delete location'
],
'/wallets' => [
'/' => 'List all wallets',
'/add' => 'Add wallet'
],
'/wallet/{wallet_id}' => [
'/' => 'Show wallet information',
'/edit' => 'Edit wallet',
'/delete' => 'Delete wallet'
]
]
];
return $this->withJson($response, $output);
}
}