Beispiel #1
0
 public LoginEventHandler(IAllRedisRepository accountRedisRep, IAccountInfoRepository accountRep, IBusControl mqBus, IMapper mapper)
 {
     _redisRep   = accountRedisRep;
     _accountRep = accountRep;
     _mqBus      = mqBus;
     _mapper     = mapper;
 }
Beispiel #2
0
 public GetAccountCmdHandler(IAllRedisRepository accountRedisRep,
                             IAccountInfoRepository accountRep,
                             IMediatorHandler bus, IRequestClient <GetMoneyMqCmd> moneyClient, IMapper mapper)
 {
     _redisRep    = accountRedisRep;
     _bus         = bus;
     _moneyClient = moneyClient;
     _mapper      = mapper;
     _accountRep  = accountRep;
 }
 public LoginCmdHandler(IAllRedisRepository accountRedisRep, IAccountInfoRepository accountRep,
                        IUserIdGenRepository genRepository, IMediatorHandler bus, IRequestClient <GetMoneyMqCmd> moneyClient,
                        IRequestClient <AddMoneyMqCmd> moneyAddClient)
 {
     _redisRep       = accountRedisRep;
     _accountRep     = accountRep;
     _genRepository  = genRepository;
     _bus            = bus;
     _moneyClient    = moneyClient;
     _moneyAddClient = moneyAddClient;
 }
Beispiel #4
0
 public AccountEventHandler(IAllRedisRepository redisRep, IAccountInfoRepository accountRep)
 {
     _redisRep   = redisRep;
     _accountRep = accountRep;
 }
Beispiel #5
0
 public GetLevelInfoCmdHandler(ILevelInfoRepository rep,
                               IAllRedisRepository redisRepository)
 {
     _levelRepository = rep;
     _redisRepository = redisRepository;
 }
Beispiel #6
0
        public static async Task <long?> GetIdByPlatForm(string platformId, IAccountInfoRepository _accountRepository, IAllRedisRepository _redis)
        {
            var checkInfo = await _redis.GetLoginCheckInfo(platformId);

            if (checkInfo == null)
            {
                AccountInfo accountInfo = await _accountRepository.GetByPlatform(platformId);

                if (accountInfo != null)
                {
                    await _redis.SetLoginCheckInfo(platformId, accountInfo);

                    return(accountInfo.Id);
                }
                return(null);
            }
            return(checkInfo.Id);
        }
Beispiel #7
0
        public static async Task <AccountInfo> GetAccountInfo(long id, IAccountInfoRepository _accountRepository, IAllRedisRepository _redis)
        {
            var accountInfo = await _redis.GetAccountInfo(id);

            if (accountInfo == null)
            {
                accountInfo = await _accountRepository.GetByIdAsync(id);

                if (accountInfo != null)
                {
                    await _redis.SetAccountInfo(accountInfo);
                }
            }
            return(accountInfo);
        }
Beispiel #8
0
 public GetGameInfoCmdHandler(IGameInfoRepository rep,
                              IAllRedisRepository redisRepository)
 {
     _gameRepository  = rep;
     _redisRepository = redisRepository;
 }