This commit is contained in:
2021-08-11 19:14:26 +08:00
parent 3ce7315250
commit 39af292171
21 changed files with 533 additions and 392 deletions
+29
View File
@@ -0,0 +1,29 @@
<?php
namespace Rpc;
use HttpServer\Controller;
use HttpServer\Exception\RequestException;
use Rpc\Annotation\RpcService;
use Server\RequestInterface;
/**
*
*/
#[RpcService(package: "default", protocol: RpcService::PROTOCOL_JSON, server: 'json-rpc')]
class DefaultRpcController extends Controller
{
/**
* @param RequestInterface $request
* @return int
* @throws RequestException
*/
public function getSystemConfig(RequestInterface $request): int
{
return $request->int('a') + $request->int('b');
}
}