This commit is contained in:
2021-10-28 10:52:09 +08:00
parent e1fcefde2d
commit ec75ccfc00
5 changed files with 93 additions and 14 deletions
+17 -2
View File
@@ -2,7 +2,11 @@
namespace Kiri\Rpc\Annotation;
#[\Attribute(\Attribute::TARGET_CLASS)] class JsonRpc
use Annotation\Attribute;
use Http\Handler\Router;
use Kiri\Kiri;
#[\Attribute(\Attribute::TARGET_CLASS)] class JsonRpc extends Attribute
{
@@ -10,10 +14,21 @@ namespace Kiri\Rpc\Annotation;
* @param string $method
* @param string $version
*/
public function __construct(public string $method, public string $version = '2.0')
public function __construct(public string $method, public string $version = '2.0', public string $protocol = 'json')
{
}
/**
* @param mixed $class
* @param mixed|string $method
* @return mixed
*/
public function execute(mixed $class, mixed $method = ''): mixed
{
return parent::execute($class, $method); // TODO: Change the autogenerated stub
}
}