mirror of
https://github.com/bitwarden/server.git
synced 2025-07-04 09:32:48 -05:00
use EventTableEntity instead of TableEntity
This commit is contained in:
@ -1,12 +1,12 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.WindowsAzure.Storage.Table;
|
||||
using Bit.Core.Models.Data;
|
||||
|
||||
namespace Bit.Core.Services
|
||||
{
|
||||
public interface IEventWriteService
|
||||
{
|
||||
Task CreateAsync(ITableEntity entity);
|
||||
Task CreateManyAsync(IList<ITableEntity> entities);
|
||||
Task CreateAsync(EventTableEntity entity);
|
||||
Task CreateManyAsync(IList<EventTableEntity> entities);
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
using System.Threading.Tasks;
|
||||
using Bit.Core.Repositories;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.WindowsAzure.Storage.Table;
|
||||
using Microsoft.WindowsAzure.Storage;
|
||||
using Microsoft.WindowsAzure.Storage.Queue;
|
||||
using Newtonsoft.Json;
|
||||
using Bit.Core.Models.Data;
|
||||
|
||||
namespace Bit.Core.Services
|
||||
{
|
||||
@ -29,14 +29,14 @@ namespace Bit.Core.Services
|
||||
_globalSettings = globalSettings;
|
||||
}
|
||||
|
||||
public async Task CreateAsync(ITableEntity entity)
|
||||
public async Task CreateAsync(EventTableEntity entity)
|
||||
{
|
||||
var json = JsonConvert.SerializeObject(entity, _jsonSettings);
|
||||
var message = new CloudQueueMessage(json);
|
||||
await _queue.AddMessageAsync(message);
|
||||
}
|
||||
|
||||
public async Task CreateManyAsync(IList<ITableEntity> entities)
|
||||
public async Task CreateManyAsync(IList<EventTableEntity> entities)
|
||||
{
|
||||
var json = JsonConvert.SerializeObject(entities, _jsonSettings);
|
||||
var message = new CloudQueueMessage(json);
|
||||
|
@ -5,7 +5,6 @@ using Bit.Core.Repositories;
|
||||
using Bit.Core.Models.Data;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.WindowsAzure.Storage.Table;
|
||||
using Bit.Core.Models.Table;
|
||||
|
||||
namespace Bit.Core.Services
|
||||
@ -31,7 +30,7 @@ namespace Bit.Core.Services
|
||||
|
||||
public async Task LogUserEventAsync(Guid userId, EventType type)
|
||||
{
|
||||
var events = new List<ITableEntity> { new UserEvent(userId, type) };
|
||||
var events = new List<EventTableEntity> { new UserEvent(userId, type) };
|
||||
|
||||
IEnumerable<UserEvent> orgEvents;
|
||||
if(_currentContext.UserId.HasValue)
|
||||
|
@ -1,7 +1,7 @@
|
||||
using System.Threading.Tasks;
|
||||
using Bit.Core.Repositories;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.WindowsAzure.Storage.Table;
|
||||
using Bit.Core.Models.Data;
|
||||
|
||||
namespace Bit.Core.Services
|
||||
{
|
||||
@ -18,12 +18,12 @@ namespace Bit.Core.Services
|
||||
_globalSettings = globalSettings;
|
||||
}
|
||||
|
||||
public async Task CreateAsync(ITableEntity entity)
|
||||
public async Task CreateAsync(EventTableEntity entity)
|
||||
{
|
||||
await _eventRepository.CreateAsync(entity);
|
||||
}
|
||||
|
||||
public async Task CreateManyAsync(IList<ITableEntity> entities)
|
||||
public async Task CreateManyAsync(IList<EventTableEntity> entities)
|
||||
{
|
||||
await _eventRepository.CreateManyAsync(entities);
|
||||
}
|
||||
|
@ -1,17 +1,17 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.WindowsAzure.Storage.Table;
|
||||
using Bit.Core.Models.Data;
|
||||
|
||||
namespace Bit.Core.Services
|
||||
{
|
||||
public class NoopEventWriteService : IEventWriteService
|
||||
{
|
||||
public Task CreateAsync(ITableEntity entity)
|
||||
public Task CreateAsync(EventTableEntity entity)
|
||||
{
|
||||
return Task.FromResult(0);
|
||||
}
|
||||
|
||||
public Task CreateManyAsync(IList<ITableEntity> entities)
|
||||
public Task CreateManyAsync(IList<EventTableEntity> entities)
|
||||
{
|
||||
return Task.FromResult(0);
|
||||
}
|
||||
|
Reference in New Issue
Block a user