125 lines
2.6 KiB
PHP
125 lines
2.6 KiB
PHP
<?php
|
|
/**
|
|
* Author: ykxiao
|
|
* Date: 2025/7/8
|
|
* Time: 下午7:57
|
|
* 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 RoleServiceConsumer extends AbstractServiceClient implements RoleServiceInterface
|
|
{
|
|
protected string $serviceName = 'RoleService';
|
|
|
|
protected string $protocol = 'jsonrpc-http';
|
|
|
|
/**
|
|
* 添加角色.
|
|
* @param array $data
|
|
* @return void
|
|
*/
|
|
public function addRole(array $data): void
|
|
{
|
|
$this->__request(__FUNCTION__, $data);
|
|
}
|
|
|
|
/**
|
|
* 获取角色列表.
|
|
* @param array $data
|
|
* @return array
|
|
*/
|
|
public function roleList(array $data): array
|
|
{
|
|
return $this->__request(__FUNCTION__, $data);
|
|
}
|
|
|
|
/**
|
|
* 禁用角色.
|
|
* @param array $data
|
|
* @return array
|
|
*/
|
|
public function disableRoles(array $data): array
|
|
{
|
|
return $this->__request(__FUNCTION__, $data);
|
|
}
|
|
|
|
/**
|
|
* 删除角色.
|
|
* @param array $data
|
|
* @return array
|
|
*/
|
|
public function deletedRoles(array $data): array
|
|
{
|
|
return $this->__request(__FUNCTION__, $data);
|
|
}
|
|
|
|
/**
|
|
* 分配用户角色.
|
|
* @param array $data
|
|
* @return array
|
|
*/
|
|
public function assignUserRoles(array $data): array
|
|
{
|
|
return $this->__request(__FUNCTION__, $data);
|
|
}
|
|
|
|
/**
|
|
* 角色授权.
|
|
* @param array $data
|
|
* @return array
|
|
*/
|
|
public function assignRolePermissions(array $data): array
|
|
{
|
|
return $this->__request(__FUNCTION__, $data);
|
|
}
|
|
|
|
/**
|
|
* 获取用户角色信息.
|
|
* @param array $data
|
|
* @return array
|
|
*/
|
|
public function getUserRoleInfo(array $data): array
|
|
{
|
|
return $this->__request(__FUNCTION__, $data);
|
|
}
|
|
|
|
/**
|
|
* 获取角色权限信息.
|
|
* @param array $data
|
|
* @return array
|
|
*/
|
|
public function getRolePermissionsByRoleId(array $data): array
|
|
{
|
|
return $this->__request(__FUNCTION__, $data);
|
|
}
|
|
|
|
/**
|
|
* 根据角色ID列表获取角色权限集合.
|
|
* @param array $data
|
|
* @return array
|
|
*/
|
|
public function getRolePermissionSetByRoleIds(array $data): array
|
|
{
|
|
return $this->__request(__FUNCTION__, $data);
|
|
}
|
|
|
|
/**
|
|
* 根据用户ID获取用户数据权限.
|
|
* @param array $data
|
|
* @return array
|
|
*/
|
|
public function getUserDataPermissions(array $data): array
|
|
{
|
|
return $this->__request(__FUNCTION__, $data);
|
|
}
|
|
} |