改名
This commit is contained in:
@@ -25,6 +25,12 @@ class GiiJsonRpc extends GiiBase
|
|||||||
|
|
||||||
namespace Rpc;
|
namespace Rpc;
|
||||||
|
|
||||||
|
use Annotation\Mapping;
|
||||||
|
use Annotation\Target;
|
||||||
|
use Rpc\Producers\\' . ucfirst($name) . 'RpcService;
|
||||||
|
|
||||||
|
#[Target]
|
||||||
|
#[Mapping(' . ucfirst($name) . 'RpcService::class)]
|
||||||
interface ' . ucfirst($name) . 'RpcInterface
|
interface ' . ucfirst($name) . 'RpcInterface
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Annotation;
|
||||||
|
|
||||||
|
use Kiri\Kiri;
|
||||||
|
|
||||||
|
#[\Attribute(\Attribute::TARGET_CLASS)] class Mapping extends Attribute
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $class
|
||||||
|
*/
|
||||||
|
public function __construct(public string $class)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param mixed $class
|
||||||
|
* @param mixed|string $method
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function execute(mixed $class, mixed $method = ''): mixed
|
||||||
|
{
|
||||||
|
Kiri::getDi()->mapping($class, $this->class);
|
||||||
|
|
||||||
|
return parent::execute($class, $method);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user