Esempio n. 1
0
        /// <summary>
        /// 获取账户对应 角色权限以及部门。租户,岗位信息
        /// </summary>
        /// <param name="uid"></param>
        /// <param name="tenancyId"></param>
        /// <returns></returns>
        public async Task <Result <Account> > GetDetails(long uid, long?tenancyId = null)
        {
            Account account = await _accountsRepository.GetAccountByPostAndRoleAsync(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));
        }