1
0
mirror of https://github.com/bitwarden/server synced 2025-12-16 08:13:33 +00:00

log user events

This commit is contained in:
Kyle Spearrin
2017-12-01 10:07:14 -05:00
parent f4586002c4
commit d94c2a8f50
7 changed files with 70 additions and 41 deletions

View File

@@ -8,23 +8,25 @@ namespace Bit.Core.Models.Data
{
public UserEvent(Guid userId, EventType type)
{
PartitionKey = $"UserId={userId}";
RowKey = string.Format("Date={0}__Type={1}",
CoreHelpers.DateTimeToTableStorageKey(), type);
UserId = userId;
Type = type;
Type = (int)type;
Timestamp = DateTime.UtcNow;
PartitionKey = $"UserId={UserId}";
RowKey = string.Format("Date={0}__Type={1}",
CoreHelpers.DateTimeToTableStorageKey(Timestamp.DateTime), Type);
}
public UserEvent(Guid userId, Guid organizationId, EventType type)
{
PartitionKey = $"OrganizationId={organizationId}";
RowKey = string.Format("Date={0}__UserId={1}__Type={2}",
CoreHelpers.DateTimeToTableStorageKey(), userId, type);
OrganizationId = organizationId;
UserId = userId;
Type = type;
Type = (int)type;
Timestamp = DateTime.UtcNow;
PartitionKey = $"OrganizationId={OrganizationId}";
RowKey = string.Format("Date={0}__UserId={1}__Type={2}",
CoreHelpers.DateTimeToTableStorageKey(Timestamp.DateTime), UserId, Type);
}
}
}