コード例 #1
0
        protected override async Task SaveUserActionAsync(
            UserRegisteredEvent data,
            MobileAppType?mobileAppType,
            long channelAttributesId,
            AttributionDataHashes attributionDataHashes,
            CancellationToken cancellation)
        {
            if (mobileAppType == null)
            {
                var userAction = new UserAction
                {
                    UserId              = data.UserId,
                    Type                = UserActionType.UserRegistered,
                    ActionDateTimeUtc   = data.Context.Timestamp,
                    ObjectType          = ObjectType.User,
                    ObjectId            = data.UserId,
                    ObjectGuid          = data.UserGuid,
                    InitiatorId         = data.Context.Initiator?.Id,
                    InitiatorType       = data.Context.Initiator?.Type,
                    ChannelAttributesId = channelAttributesId,
                    ActualHash          = attributionDataHashes.ActualHash,
                    LingeringHash       = attributionDataHashes.LingeringHash
                };

                await _userActionManager.SaveUserActionAsync(userAction);
            }
        }
コード例 #2
0
        protected override async Task SaveUserActionAsync(
            TaskCreatedEvent data,
            MobileAppType?mobileAppType,
            long channelAttributesId,
            AttributionDataHashes attributionDataHashes,
            CancellationToken cancellation)
        {
            if (mobileAppType != null)
            {
                // обрабатываем создание заданий только из веба
                return;
            }

            var userAction = new UserAction
            {
                UserId              = data.NewTaskEntity.CreatorId,
                Type                = UserActionType.TaskCreated,
                ActionDateTimeUtc   = data.Context.Timestamp,
                ObjectType          = ObjectType.Task,
                ObjectId            = data.NewTaskEntity.Id,
                ObjectGuid          = data.NewTaskEntity.Attributes?.TaskGuid,
                InitiatorId         = data.Context.Initiator?.Id,
                InitiatorType       = data.Context.Initiator?.Type,
                ChannelAttributesId = channelAttributesId,
                ActualHash          = attributionDataHashes.ActualHash,
                LingeringHash       = attributionDataHashes.LingeringHash
            };

            await _userActionManager.SaveUserActionAsync(userAction);
        }