This commit is contained in:
37
app/JsonRpc/EasyAppServiceConsumer.php
Normal file
37
app/JsonRpc/EasyAppServiceConsumer.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/**
|
||||
* Author: ykxiao
|
||||
* Date: 2025/6/4
|
||||
* Time: 上午10:11
|
||||
* Description:
|
||||
*
|
||||
* (c) ykxiao <yk_9001@hotmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\JsonRpc;
|
||||
|
||||
use Hyperf\RpcClient\AbstractServiceClient;
|
||||
|
||||
class EasyAppServiceConsumer extends AbstractServiceClient implements EasyAppServiceInterface
|
||||
{
|
||||
// 定义对应服务提供者的服务名
|
||||
protected string $serviceName = 'EasyAppService';
|
||||
|
||||
// 定义对应服务提供者的服务协议
|
||||
protected string $protocol = 'jsonrpc-http';
|
||||
|
||||
/**
|
||||
* 获取客户端IP信息
|
||||
* @param array $params
|
||||
* @return array
|
||||
*/
|
||||
public function getClientIpInfo(array $params): array
|
||||
{
|
||||
return $this->__request(__FUNCTION__, $params);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user