Example #1
0
        /// <summary>
        /// 获取角色下的员工列表
        /// </summary>
        /// <param name="accessToken">accessToken</param>
        /// <param name="roleId">角色ID</param>
        /// <param name="offSet">分页偏移,默认值:0</param>
        /// <param name="size">分页大小,默认值:20,最大值200</param>
        /// <returns></returns>
        public OapiRoleSimplelistResponse SimpleListByRole(string accessToken, long roleId, long offSet = 0, long size = 20)
        {
            IDingTalkClient           client  = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/role/simplelist");
            OapiRoleSimplelistRequest request = new OapiRoleSimplelistRequest();

            request.RoleId = roleId;
            request.Offset = offSet;
            request.Size   = size;
            OapiRoleSimplelistResponse response = client.Execute(request, accessToken);

            return(response);
        }
Example #2
0
        /// <summary>
        /// 返回指定解色的所有用户,已弃用
        /// </summary>
        /// <param name="roleId"></param>
        /// <returns></returns>
        public List <OapiRoleSimplelistResponse.OpenEmpSimpleDomain> GetRoleUserList(long roleId)
        {
            IDingTalkClient           client  = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/role/simplelist");
            OapiRoleSimplelistRequest request = new OapiRoleSimplelistRequest
            {
                RoleId = roleId,
                Offset = 0L,
                Size   = 10L
            };
            OapiRoleSimplelistResponse response = client.Execute(request, DbOper.AccessToken);

            return(response.Result.List);
        }