public async Task Handle(InvitedFriendRegisterdEvent notification, CancellationToken cancellationToken)
        {
            var allInviters = await _redis.GetInviter(notification.PlatformAccount);

            if (allInviters == null || allInviters.Count() == 0)
            {
                return;
            }
            long rewardCoins = RewardManager.InviteRewardConf.InviteRewards;

            allInviters.ForEach(x => _mqBus.Publish(new AddMoneyMqCmd(x, rewardCoins, 0, Commons.Enums.AddReason.Invite)));
            await _redis.RemovInviteFriend(allInviters, notification.PlatformAccount);
        }
Exemplo n.º 2
0
        public async Task Handle(InvitedFriendRegisterdEvent notification, CancellationToken cancellationToken)
        {
            var allInviters = await _redis.GetInviter(notification.PlatformAccount, notification.Type);

            if (allInviters == null || allInviters.Count == 0)
            {
                return;
            }
            long rewardCoins = _inviteConfig.InviteRewards;

            foreach (var oneInviter in allInviters)
            {
                _ = _mqBus.Publish(new AddMoneyMqCommand(oneInviter, rewardCoins, 0, Commons.Extenssions.Defines.AddReason.Invite));
            }
            await _redis.RemovInviteFriend(allInviters, notification.PlatformAccount, notification.Type);
        }