v0.1.0
This commit is contained in:
27
backend/api/common/Controller/Update.php
Normal file
27
backend/api/common/Controller/Update.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?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;
|
||||
use ProVM\Crypto\Common\Service\Update as Updater;
|
||||
|
||||
class Update {
|
||||
use JSON;
|
||||
|
||||
public function __invoke(Request $request, Response $response, Updater $updater) {
|
||||
$result = $updater->run();
|
||||
$output = [
|
||||
'result' => $result
|
||||
];
|
||||
return $this->withJson($response, $output);
|
||||
}
|
||||
public function register(Request $request, Response $response, Updater $updater, $coin_id, $type) {
|
||||
$result = $updater->register($coin_id, $type);
|
||||
$output = [
|
||||
'input' => ['coin_id' => $coin_id, 'type' => $type],
|
||||
'result' => $result
|
||||
];
|
||||
return $this->withJson($response, $output);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user