1234567891011121314151617181920212223242526272829303132333435363738 |
- <?php
- namespace App\JsonRpc;
- use Hyperf\RpcClient\AbstractServiceClient;
- class AdService extends AbstractServiceClient implements AdServiceInterface
- {
- /**
- * 定义对应服务提供者的服务名称
- * @var string
- */
- protected string $serviceName = 'AdService';
- /**
- * 定义对应服务提供者的服务协议
- * @var string
- */
- protected string $protocol = 'jsonrpc-http';
- /**
- * @param string $name
- * @param string $url
- * @return mixed|string
- */
- public function createAd(string $name, string $url)
- {
- return $this->__request(__FUNCTION__, compact('name', 'url'));
- }
- /**
- * @param int $id
- * @return array|mixed
- */
- public function getAdInfo(int $id)
- {
- return $this->__request(__FUNCTION__, compact('id'));
- }
- }
|