Добавьте файлы проекта.
This commit is contained in:
28
PlaylistShared.Api/Entities/ApplicationUser.cs
Normal file
28
PlaylistShared.Api/Entities/ApplicationUser.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
|
||||
namespace PlaylistShared.Api.Entities;
|
||||
|
||||
/// <summary>Пользователь приложения (расширяет IdentityUser).</summary>
|
||||
public class ApplicationUser : IdentityUser<Guid>
|
||||
{
|
||||
/// <summary>Идентификатор пользователя в Яндексе (если привязан).</summary>
|
||||
public string? YandexId { get; set; }
|
||||
|
||||
/// <summary>Access токен Яндекс.Музыки (зашифрованный).</summary>
|
||||
public string? YandexAccessToken { get; set; }
|
||||
|
||||
/// <summary>Refresh токен Яндекс.Музыки (зашифрованный).</summary>
|
||||
public string? YandexRefreshToken { get; set; }
|
||||
|
||||
/// <summary>Время истечения access токена Яндекса.</summary>
|
||||
public DateTime YandexTokenExpiryUtc { get; set; }
|
||||
|
||||
/// <summary>Refresh токен для JWT (хранится в БД).</summary>
|
||||
public string? RefreshToken { get; set; }
|
||||
|
||||
/// <summary>Время истечения refresh токена JWT.</summary>
|
||||
public DateTime RefreshTokenExpiryUtc { get; set; }
|
||||
|
||||
/// <summary>Плейлисты, созданные пользователем.</summary>
|
||||
public ICollection<SharedPlaylistEntity> OwnedPlaylists { get; set; } = new List<SharedPlaylistEntity>();
|
||||
}
|
||||
26
PlaylistShared.Api/Entities/SharedPlaylistEntity.cs
Normal file
26
PlaylistShared.Api/Entities/SharedPlaylistEntity.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using PlaylistShared.Shared.Enums;
|
||||
|
||||
namespace PlaylistShared.Api.Entities;
|
||||
|
||||
/// <summary>Сущность шеринг-плейлиста (таблица в БД).</summary>
|
||||
public class SharedPlaylistEntity
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid CreatorUserId { get; set; }
|
||||
public string YandexPlaylistKind { get; set; } = null!;
|
||||
public string YandexPlaylistOwnerUid { get; set; } = null!;
|
||||
public string Title { get; set; } = null!;
|
||||
public string? Description { get; set; }
|
||||
public string? CoverUrl { get; set; }
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public DateTime UpdatedAt { get; set; }
|
||||
public bool IsDeleted { get; set; }
|
||||
public string ShareToken { get; set; } = null!;
|
||||
public ViewPermission ViewPermission { get; set; }
|
||||
public EditPermission AddPermission { get; set; }
|
||||
public EditPermission RemovePermission { get; set; }
|
||||
|
||||
// Навигационные свойства
|
||||
public ApplicationUser Creator { get; set; } = null!;
|
||||
public ICollection<TrackAdditionLogEntity> TrackAdditionLogs { get; set; } = new List<TrackAdditionLogEntity>();
|
||||
}
|
||||
15
PlaylistShared.Api/Entities/TrackAdditionLogEntity.cs
Normal file
15
PlaylistShared.Api/Entities/TrackAdditionLogEntity.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
namespace PlaylistShared.Api.Entities;
|
||||
|
||||
/// <summary>Лог добавления трека (таблица в БД).</summary>
|
||||
public class TrackAdditionLogEntity
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid SharedPlaylistId { get; set; }
|
||||
public string TrackId { get; set; } = null!;
|
||||
public Guid AddedByUserId { get; set; }
|
||||
public DateTime AddedAtUtc { get; set; }
|
||||
|
||||
// Навигационные свойства
|
||||
public SharedPlaylistEntity SharedPlaylist { get; set; } = null!;
|
||||
public ApplicationUser AddedByUser { get; set; } = null!;
|
||||
}
|
||||
Reference in New Issue
Block a user