| | |
| | | |
| | | using LifePayment.Application.Contracts; |
| | | using LifePayment.Domain; |
| | | using LifePayment.Domain.LifePay; |
| | | using LifePayment.Domain.Models; |
| | | using LifePayment.Domain.Shared; |
| | | using Microsoft.EntityFrameworkCore; |
| | |
| | | private readonly IRepository<User, Guid> _userRepository; |
| | | private readonly IRepository<UserChannle, Guid> _userChannleRep; |
| | | private readonly IIdentityUserAppService _identityUserService; |
| | | private readonly IRepository<LifePayPromoter, Guid> lifePayPromoterRepository; |
| | | private readonly IDistributedCache<string> _distributedCache; |
| | | |
| | | |
| | |
| | | IIdentityModelAuthenticationService authenticator, |
| | | IRepository<User, Guid> userRepository, |
| | | IIdentityUserAppService identityUserService, |
| | | IRepository<LifePayPromoter, Guid> lifePayPromoterRepository, |
| | | IRepository<LifePayUser, Guid> lifePayUserRepository, |
| | | IRepository<LifePayChannles, Guid> lifePayChannlesRepository, |
| | | IRepository<UserChannle, Guid> userChannleRep, |
| | |
| | | _configuration = configuration; |
| | | _wxManager = wxManager; |
| | | _identityUserService = identityUserService; |
| | | this.lifePayPromoterRepository = lifePayPromoterRepository; |
| | | _lifePayUserRepository = lifePayUserRepository; |
| | | _lifePayChannlesRepository = lifePayChannlesRepository; |
| | | _authenticator = authenticator; |
| | |
| | | { |
| | | Name = s.ChannlesName, |
| | | ChannlesId = s.Id, |
| | | ChannlesNum = s.ChannlesNum |
| | | ChannlesNum = s.ChannlesNum, |
| | | SwitchType = s.SwitchType, |
| | | }).ToListAsync(); |
| | | |
| | | BackClientUserInfoOutput result = new BackClientUserInfoOutput() |
| | | { |
| | | IsBackClientUser = CurrentUser.ClientId == Constant.ClientType.Back, |
| | | IsSystem = CurrentUser.IsSystem, |
| | | ChannleList = channleList |
| | | }; |
| | | return result; |
| | |
| | | && x.PhoneNumber == input.PhoneNumber).FirstOrDefaultAsync(); |
| | | if (backClientUser != null) |
| | | { |
| | | channlesNum = await _userChannleRep.Where(x => x.UserId == backClientUser.Id) |
| | | .Select(s => new ChannelOutput() |
| | | { |
| | | Name = _lifePayChannlesRepository.Where(x => x.ChannlesNum == s.ChannleId).Select(r => r.ChannlesName).FirstOrDefault(), |
| | | ChannlesNum = s.ChannleId |
| | | }).ToListAsync(); |
| | | var channlesNums = await _userChannleRep.Where(x => x.UserId == backClientUser.Id).Select(s => s.ChannleId).Distinct().ToListAsync(); |
| | | channlesNum = await _lifePayChannlesRepository.Where(x => channlesNums.Contains(x.ChannlesNum)).Select(s => new ChannelOutput() |
| | | { |
| | | Name = s.ChannlesName, |
| | | ChannlesId = s.Id, |
| | | ChannlesNum = s.ChannlesNum, |
| | | SwitchType = s.SwitchType, |
| | | }).ToListAsync(); |
| | | } |
| | | |
| | | var result = await LifePayUserMesssageByPhone(lifeUser.PhoneNumber); |
| | |
| | | var lifeUser = await _lifePayUserRepository.Where(x => x.Id == id).FirstOrDefaultAsync(); |
| | | CheckExtensions.IfTrueThrowUserFriendlyException(lifeUser == null, |
| | | "用户不存在"); |
| | | |
| | | var result = await LifePayUserMesssageByPhone(lifeUser.PhoneNumber); |
| | | result.UserId = id; |
| | | var promoter = await lifePayPromoterRepository.FirstOrDefaultAsync(it => it.PhoneNumber == lifeUser.PhoneNumber); |
| | | if (promoter != null) |
| | | { |
| | | result.PromoterIdNumber = promoter.IdNumber; |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | |
| | |
| | | && x.PhoneNumber == phoneNumber).FirstOrDefaultAsync(); |
| | | if (backClientUser != null) |
| | | { |
| | | channlesNum = await _userChannleRep.Where(x => x.UserId == backClientUser.Id) |
| | | .Select(s => new ChannelOutput() |
| | | { |
| | | Name = _lifePayChannlesRepository.Where(x => x.ChannlesNum == s.ChannleId).Select(r => r.ChannlesName).FirstOrDefault(), |
| | | ChannlesNum = s.ChannleId |
| | | }).ToListAsync(); |
| | | var channlesNums = await _userChannleRep.Where(x => x.UserId == backClientUser.Id).Select(s => s.ChannleId).Distinct().ToListAsync(); |
| | | channlesNum = await _lifePayChannlesRepository.Where(x => channlesNums.Contains(x.ChannlesNum)).Select(s => new ChannelOutput() |
| | | { |
| | | Name = s.ChannlesName, |
| | | ChannlesId = s.Id, |
| | | ChannlesNum = s.ChannlesNum, |
| | | SwitchType = s.SwitchType, |
| | | }).ToListAsync(); |
| | | } |
| | | |
| | | LifePayPhoneMesssageCodeLoginOutput result = new LifePayPhoneMesssageCodeLoginOutput() |