<commit_before><?php

declare(strict_types=1);

/*
 * This file is part of eelly package.
 *
 * (c) eelly.com
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Eelly\SDK\Oauth\Service;

/**
 * @author liangxinyi<<EMAIL>>
 */
interface RoleInterface
{
    /**
     * 获得角色列表.
     *
     * @return array  返回角色列表
     * @requestExample()
     * @returnExample([{"role_id":"1","role_name":"\u7cfb\u7edf\u7ba1\u7406\u5458","default_permission":"*\/*\/*","created_time":"0","update_time":"2017-06-21 17:36:49"}])
     * @author liangxinyi<<EMAIL>>
     * @since 2017-7-25
     */
    public function listRole(): array;

    /**
     * 更新角色信息.
     *
     * @param int $roleId 角色id
     * @param string $roleName 角色名
     * @param string $defaultPermission 角色权限
     * @return bool 返回bool
     * @requestExample([1,"管理员","*"])
     * @returnExample(true)
     * @author liangxinyi<<EMAIL>>
     * @since 2017-5-25
     */
    public function updateRole(int $roleId, string $roleName, string $defaultPermission): bool;

    /**
     * 增加角色接口.
     *
     * 新增角色.
     *
     * @param string $roleName
     * @return int 新增角色id
     * @requestExample(['测试示例'])
     * @returnExample([1])
     * @author liangxinyi<<EMAIL>>
     * @since 2017-7-25
     *
     */
    public function addRole(string $roleName,string $defaultPermission): int;

    /**
     * 批量新增|更新角色客户端.
     *
     * @param int $roleId 角色id
     * @param array $clientIds 客户端id数组
     * @return bool
     * @requestExample([1,[1,2,3,4]])
     * @returnExample(true)
     * @author liangxinyi<<EMAIL>>
     * @since 2017-7-25
     */
    public function addRoleClient(int $roleId, array $clientIds): bool;

    /**
     * 批量新增|更新角色权限.
     *
     * @param int $roleId 角色id<commit_msg>改动一个接口名<commit_after><?php

declare(strict_types=1);

/*
 * This file is part of eelly package.
 *
 * (c) eelly.com
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Eelly\SDK\Oauth\Service;

/**
 * @author liangxinyi<<EMAIL>>
 */
interface RoleInterface
{
    /**
     * 获得角色列表.
     *
     * @return array  返回角色列表
     * @requestExample()
     * @returnExample([{"role_id":"1","role_name":"\u7cfb\u7edf\u7ba1\u7406\u5458","default_permission":"*\/*\/*","created_time":"0","update_time":"2017-06-21 17:36:49"}])
     * @author liangxinyi<<EMAIL>>
     * @since 2017-7-25
     */
    public function listRole(): array;

    /**
     * 更新角色信息.
     *
     * @param int $roleId 角色id
     * @param string $roleName 角色名
     * @param string $defaultPermission 角色权限
     * @return bool 返回bool
     * @requestExample([1,"管理员","*"])
     * @returnExample(true)
     * @author liangxinyi<<EMAIL>>
     * @since 2017-5-25
     */
    public function updateRole(int $roleId, string $roleName, string $defaultPermission): bool;

    /**
     * 增加角色接口.
     *
     * 新增角色.
     *
     * @param string $roleName
     * @return int 新增角色id
     * @requestExample(['测试示例'])
     * @returnExample([1])
     * @author liangxinyi<<EMAIL>>
     * @since 2017-7-25
     *
     */
    public function addRole(string $roleName,string $defaultPermission): int;

    /**
     * 批量新增|更新角色客户端.
     *
     * @param int $roleId 角色id
     * @param array $clientIds 客户端id数组
     * @return bool
     * @requestExample([1,[1,2,3,4]])
     * @returnExample(true)
     * @author liangxinyi<<EMAIL>>
     * @since 2017-7-25
     */
    public function addRoleClientBatch(int $roleId, array $clientIds): bool;

    /**
     * 批量新增|更新角色权限.
     *
     * @param int $roleId 角色id
{'fraction_non_alphanumeric': 0.15527104331244893, 'fraction_numerical': 0.03486788341051485, 'mean_word_length': 2.603532875368008, 'pattern_counts': {'":': 10, '<': 25, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '962109', 'n_tokens_mistral': 1455, 'n_tokens_neox': 1438, 'n_words': 261}