2021-10-24 20:15:09 +01:00
|
|
|
using System;
|
2021-10-24 22:40:15 +01:00
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
2021-10-24 20:15:09 +01:00
|
|
|
using Microsoft.AspNetCore.Identity;
|
2021-10-24 22:40:15 +01:00
|
|
|
using Microsoft.EntityFrameworkCore;
|
2021-10-24 20:15:09 +01:00
|
|
|
|
|
|
|
namespace Selector.Model
|
|
|
|
{
|
|
|
|
public class ApplicationUser : IdentityUser
|
|
|
|
{
|
2021-10-24 22:40:15 +01:00
|
|
|
public bool SpotifyIsLinked { get; set; }
|
|
|
|
public DateTime SpotifyLastRefresh { get; set; }
|
|
|
|
public int SpotifyTokenExpiry { get; set; }
|
|
|
|
public string SpotifyAccessToken { get; set; }
|
|
|
|
public string SpotifyRefreshToken { get; set; }
|
|
|
|
|
|
|
|
public string LastFmUsername { get; set; }
|
2022-02-16 23:38:45 +00:00
|
|
|
public bool SaveScrobbles { get; set; }
|
2021-10-24 22:40:15 +01:00
|
|
|
|
|
|
|
public List<Watcher> Watchers { get; set; }
|
2022-02-16 23:38:45 +00:00
|
|
|
public List<UserScrobble> Scrobbles { get; set; }
|
2021-10-24 20:15:09 +01:00
|
|
|
}
|
2021-10-26 19:26:41 +01:00
|
|
|
|
|
|
|
public class ApplicationUserDTO
|
|
|
|
{
|
2021-11-05 18:41:45 +00:00
|
|
|
public string Id { get; set; }
|
2021-10-26 19:26:41 +01:00
|
|
|
public string UserName { get; set; }
|
|
|
|
public string Email { get; set; }
|
|
|
|
public string PhoneNumber { get; set; }
|
2021-11-05 18:41:45 +00:00
|
|
|
public bool LockoutEnabled { get; set; }
|
2021-10-26 19:26:41 +01:00
|
|
|
|
|
|
|
public bool SpotifyIsLinked { get; set; }
|
|
|
|
public DateTime SpotifyLastRefresh { get; set; }
|
|
|
|
public int SpotifyTokenExpiry { get; set; }
|
|
|
|
public string SpotifyAccessToken { get; set; }
|
|
|
|
public string SpotifyRefreshToken { get; set; }
|
|
|
|
|
|
|
|
public string LastFmUsername { get; set; }
|
|
|
|
|
|
|
|
public static explicit operator ApplicationUserDTO(ApplicationUser user) => new() {
|
2021-11-05 18:41:45 +00:00
|
|
|
Id = user.Id,
|
2021-10-26 19:26:41 +01:00
|
|
|
UserName = user.UserName,
|
|
|
|
Email = user.Email,
|
|
|
|
PhoneNumber = user.PhoneNumber,
|
2021-11-05 18:41:45 +00:00
|
|
|
LockoutEnabled = user.LockoutEnabled,
|
2021-10-26 19:26:41 +01:00
|
|
|
|
|
|
|
SpotifyIsLinked = user.SpotifyIsLinked,
|
|
|
|
SpotifyLastRefresh = user.SpotifyLastRefresh,
|
|
|
|
SpotifyTokenExpiry = user.SpotifyTokenExpiry,
|
|
|
|
SpotifyAccessToken = user.SpotifyAccessToken,
|
|
|
|
SpotifyRefreshToken = user.SpotifyRefreshToken,
|
|
|
|
|
|
|
|
LastFmUsername = user.LastFmUsername
|
|
|
|
};
|
|
|
|
}
|
2021-10-24 20:15:09 +01:00
|
|
|
}
|