/// <summary>
        /// 获取所有菜单
        /// </summary>
        /// <param name="applicationId">应用程序标识</param>
        /// <param name="roleId">角色标识</param>
        public async Task <List <SelectModuleResponse> > GetAllMenusAsync(Guid applicationId, Guid roleId)
        {
            var modules = await ModuleRepository.GetModulesAsync(applicationId);

            var operations = await OperationRepository.GetAllOperationsAsync(applicationId);

            var permissions = await PermissionRepository.GetResourceIdsAsync(applicationId, roleId, false);

            var result = new SelectMenuResult(modules, operations, permissions);

            return(result.GetResult());
        }
        /// <summary>
        /// 获取角色菜单
        /// </summary>
        /// <param name="applicationId">应用程序标识</param>
        /// <param name="roleId">角色标识</param>
        public async Task <List <SelectModuleResponse> > GetRoleMenusAsync(Guid applicationId, Guid roleId)
        {
            var role = await RoleRepository.FindAsync(roleId);

            var roleIds = new List <Guid>()
            {
                roleId, role.ParentId.SafeValue()
            };
            var modules = await ModuleRepository.GetModulesAsync(applicationId, roleIds);

            var operations = await OperationRepository.GetOperationsAsync(applicationId, roleIds);

            var permissions = await PermissionRepository.GetResourceIdsAsync(applicationId, roleId, false);

            var result = new SelectMenuResult(modules, operations, permissions);

            return(result.GetResult());
        }