Lisoveliy aebe654c38
Some checks are pending
Deploy / update (push) Waiting to run
Build Project .NET / build (push) Waiting to run
chore: init commit from GitHub
2025-05-12 19:44:33 +03:00

28 lines
684 B
C#

using System.Text.Json.Serialization;
using SWAD.API.Services.MusicAPI.Auth;
namespace SWAD.API.Models.JsonStructures.MusicAPI;
public abstract class DefaultAuthResponse : IAuthResponse
{
private int? _expire;
private DateTime? _revokedAt;
[JsonPropertyName("access_token")]
// ReSharper disable once NullableWarningSuppressionIsUsed
public string Token { get; set; } = null!;
[JsonPropertyName("expires_in")]
public int? ExpireTime
{
get => _expire;
set
{
_expire = value;
_revokedAt = DateTime.UtcNow;
}
}
public DateTime? ExpireAt => _revokedAt?.AddSeconds(ExpireTime ?? 0);
}