Пример #1
0
        /// <summary>
        /// 获取账户对应岗位和部门
        /// </summary>
        /// <param name="uid"></param>
        /// <param name="tenancyId"></param>
        /// <returns></returns>
        public async Task <Result <Account> > GetAccountByPostAsync(long uid, long?tenancyId = null)
        {
            Account account = await _accountsRepository.GetAccountByPostAsync(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));
        }