Добавлено управление сессиями

This commit is contained in:
FrigaT
2026-04-14 01:39:25 +03:00
parent 40ea9166d2
commit fbfc6990e6
22 changed files with 1509 additions and 51 deletions

View File

@@ -0,0 +1,22 @@
using PlaylistShared.Api.Data;
public class TrackRemovalLogService
{
private readonly ApplicationDbContext _db;
public TrackRemovalLogService(ApplicationDbContext db) => _db = db;
public async Task LogRemovalAsync(Guid sharedPlaylistId, string trackId, Guid? removedByUserId, string sessionId)
{
var log = new TrackRemovalLog
{
Id = Guid.NewGuid(),
SharedPlaylistId = sharedPlaylistId,
TrackId = trackId,
RemovedByUserId = removedByUserId,
RemovedAtUtc = DateTime.UtcNow,
SessionId = sessionId
};
_db.TrackRemovalLogs.Add(log);
await _db.SaveChangesAsync();
}
}