Exemplo n.º 1
0
        /// <summary>
        /// 获取账户登录权限信息
        /// </summary>
        /// <param name="uid"></param>
        /// <param name="tenancyId">租户id</param>
        /// <returns></returns>
        public async Task <Result <Account> > GetAccountInfo(long uid, long?tenancyId = null)
        {
            Account account = await _accountsRepository.GetAccountAndRoleAndPermissionAsync(uid, tenancyId);

            if (account == null)
            {
                return(Result <Account> .ReFailure(ResultCodes.AccountNotExist));
            }
            if (account.IsDeleted != null && (Status)account.IsDeleted == Status.Yes)
            {
                return(Result <Account> .ReFailure(ResultCodes.AccountUnavailable));
            }
            return(Result <Account> .ReSuccess(account));
        }