Files
wh-api/app/JsonRpc/UserAuthServiceConsumer.php
ykxiao 8a3ab17b25
Some checks failed
Build Docker / build (push) Has been cancelled
增加基础配置
2025-07-12 11:59:33 +08:00

86 lines
1.7 KiB
PHP

<?php
/**
* Author: ykxiao
* Date: 2025/6/3
* Time: 下午8:36
* 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;
/**
* Author: ykxiao
* Date: 2025/6/3
* Time: 下午8:37
* 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.
*/
class UserAuthServiceConsumer extends AbstractServiceClient implements UserAuthServiceInterface
{
protected string $serviceName = 'UserAuthService';
protected string $protocol = 'jsonrpc-http';
/**
* 用户登录
* @param array $data
* @return array
*/
public function userLogin(array $data): array
{
return $this->__request(__FUNCTION__, $data);
}
/**
* 用户登出
* @param array $data
* @return void
*/
public function userLogout(array $data): void
{
$this->__request(__FUNCTION__, $data);
}
/**
* 添加用户.
* @param array $data
* @return void
*/
public function addUser(array $data): void
{
$this->__request(__FUNCTION__, $data);
}
/**
* 获取用户信息
* @param array $data
* @return array
*/
public function userInfoByToken(array $data): array
{
return $this->__request(__FUNCTION__, $data);
}
/**
* 获取用户列表.
* @param array $data
* @return array
*/
public function userList(array $data): array
{
return $this->__request(__FUNCTION__, $data);
}
}