v0.1.0
This commit is contained in:
46
backend/api/common/Controller/API.php
Normal file
46
backend/api/common/Controller/API.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user