コード例 #1
0
        public List <UserProfile> GetUserProfileListForL2(string cellphone, int country, string orderByFiled, bool isDesc, int?L2VerifyStatus, int pageSize, int index, out int totalCount)
        {
            var routerDAC = new ProfileRouterDAC();
            var server    = routerDAC.GetRouter(country);

            if (server == null)
            {
                throw new InvalidProfileServiceException();
            }

            var dac = new UserProfileRPC(server);

            return(dac.GetUserProfileListForL2(cellphone, country, orderByFiled, isDesc, L2VerifyStatus, pageSize, index, out totalCount));
        }
コード例 #2
0
        public static ProfileRouter GetByCountryId(int countryId)
        {
            if (_dict.Keys.Contains(countryId))
            {
                return(_dict[countryId]);
            }

            var dac  = new ProfileRouterDAC();
            var data = dac.GetRouter(countryId);

            if (data != null)
            {
                _dict.Add(countryId, data);
            }

            return(data);
        }
コード例 #3
0
        public UserProfileSet GetUserProfileSet(Guid id)
        {
            var            profileSet     = new UserProfileSet();
            UserAccountDAC userAccountDAC = new UserAccountDAC();
            UserAccount    userAccount    = userAccountDAC.GetById(id);

            if (userAccount == null)
            {
                return(null);//查无
            }
            //赋值
            profileSet.Id                = userAccount.Id;
            profileSet.Cellphone         = userAccount.Cellphone;
            profileSet.Email             = userAccount.Email;
            profileSet.IsVerifiedEmail   = userAccount.IsVerifiedEmail;
            profileSet.RegistrationDate  = userAccount.RegistrationDate;
            profileSet.CountryId         = userAccount.CountryId;
            profileSet.Photo             = userAccount.Photo;
            profileSet.Password          = userAccount.Password;
            profileSet.Pin               = userAccount.Pin;
            profileSet.SecretKey         = userAccount.SecretKey;
            profileSet.Status            = userAccount.Status;
            profileSet.IsAllowWithdrawal = userAccount.IsAllowWithdrawal;
            profileSet.IsAllowExpense    = userAccount.IsAllowExpense;
            profileSet.FiatCurrency      = userAccount.FiatCurrency;
            profileSet.InvitationCode    = userAccount.InvitationCode;
            profileSet.InviterCode       = userAccount.InviterCode;
            profileSet.ValidationFlag    = userAccount.ValidationFlag;
            profileSet.AuthSecretKey     = userAccount.AuthSecretKey;


            var         routerDAC   = new ProfileRouterDAC();
            var         server      = routerDAC.GetRouter(userAccount.CountryId);
            UserProfile userProfile = null;

            if (server == null)
            {
                throw new InvalidProfileServiceException();
            }

            var userProfileDAC = new UserProfileRPC(server);

            userProfile = userProfileDAC.GetById(userAccount.Id);
            if (userProfile != null)
            {
                profileSet.UserAccountId = userProfile.UserAccountId;
                profileSet.LastName      = userProfile.LastName;
                profileSet.FirstName     = userProfile.FirstName;
                //profileSet.Fullname = userProfile.Fullname;
                profileSet.IdentityDocNo   = userProfile.IdentityDocNo;
                profileSet.IdentityDocType = userProfile.IdentityDocType;
                //profileSet.IdentityDocFile = userProfile.IdentityDocFile;
                //profileSet.IsIdentityDocVerified = userProfile.IsIdentityDocVerified;
                profileSet.IdentityExpiryDate = userProfile.IdentityExpiryDate;
                profileSet.DateOfBirth        = userProfile.DateOfBirth;
                profileSet.Address1           = userProfile.Address1;
                profileSet.Address2           = userProfile.Address2;
                profileSet.City               = userProfile.City;
                profileSet.State              = userProfile.State;
                profileSet.Postcode           = userProfile.Postcode;
                profileSet.Country            = userProfile.Country;
                profileSet.Gender             = userProfile.Gender;
                profileSet.FrontIdentityImage = userProfile.FrontIdentityImage;
                profileSet.ResidentImage      = userProfile.ResidentImage;
                profileSet.BackIdentityImage  = userProfile.BackIdentityImage;
                profileSet.HandHoldWithCard   = userProfile.HandHoldWithCard;
                profileSet.L1VerifyStatus     = userProfile.L1VerifyStatus;
                profileSet.L2VerifyStatus     = userProfile.L2VerifyStatus;
                profileSet.L1SubmissionDate   = userProfile.L1SubmissionDate;
                profileSet.L2SubmissionDate   = userProfile.L2SubmissionDate;
                profileSet.L1Remark           = userProfile.L1Remark;
                profileSet.L2Remark           = userProfile.L2Remark;
            }
            return(profileSet);
        }
コード例 #4
0
        /// <summary>
        ///  查询用户状态列表
        /// </summary>
        /// <param name="cellphone"></param>
        /// <param name="country"></param>
        /// <param name="status"></param>
        /// <param name="pageSize"></param>
        /// <param name="index"></param>
        /// <param name="totalCount"></param>
        /// <returns></returns>
        public List <UserAccountStatus> GetUserAccountStatusList(string cellphone, int country, int?status, int pageSize, int index, out int totalCount)
        {
            var routerDAC = new ProfileRouterDAC();
            var list      = new List <UserAccountStatus>();

            var accountDAC  = new UserAccountDAC();
            var accountList = accountDAC.GetUserAccountStatusList(cellphone, country, status, pageSize, index, out totalCount);
            var guids       = new List <Guid>();

            if (accountList != null)
            {
                foreach (var ac in accountList)
                {
                    guids.Add(ac.Id);
                }
            }
            else
            {
                return(null);
            }

            //UserLoginLogDAC logDAC = new UserLoginLogDAC();
            //List<UserLoginLog> logs = logDAC.GetLastLoginTimeListByIds(guids);

            var server = routerDAC.GetRouter(country);

            if (server == null)
            {
                throw new InvalidProfileServiceException();
            }

            var dac         = new UserProfileRPC(server);
            var profileList = dac.GetListByIds(guids);

            foreach (var account in accountList)
            {
                //UserLoginLog log = null;
                var accountStatus = new UserAccountStatus
                {
                    UserAccountId     = account.Id,
                    IsAllowExpense    = account.IsAllowExpense,
                    IsAllowWithdrawal = account.IsAllowWithdrawal,
                    Cellphone         = account.Cellphone,
                    Country           = account.CountryId,
                    RegistrationDate  = account.RegistrationDate,
                    Status            = account.Status
                };
                UserProfile profile = null;
                if (profileList != null)
                {
                    foreach (var item in profileList)
                    {
                        if (item.UserAccountId == account.Id)
                        {
                            profile = item;
                            break;
                        }
                    }
                }
                if (profile != null)
                {
                    accountStatus.L1VerifyStatus = profile.L1VerifyStatus;
                    accountStatus.L2VerifyStatus = profile.L2VerifyStatus;
                    //accountStatus.Remark = profile.Remark;
                }

                //if (logs != null)
                //{
                //    foreach (var item in logs)
                //    {
                //        if (item.UserAccountId == account.Id)
                //        {
                //            log = item;
                //            break;
                //        }
                //    }
                //}
                //if (log != null)
                //{
                //    accountStatus.LastLoginTimeStamp = log.Timestamp;
                //}

                list.Add(accountStatus);
            }
            return(list);
        }