#145 : Ajout du seeder Spotify.
This commit is contained in:
34
Webzine.Business/DTOs/Spotify/SpotifyAlbumDto.cs
Normal file
34
Webzine.Business/DTOs/Spotify/SpotifyAlbumDto.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
namespace Webzine.Business.DTOs.Spotify
|
||||
{
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
/// <summary>
|
||||
/// Objet album de spotify.
|
||||
/// </summary>
|
||||
public class SpotifyAlbumDto
|
||||
{
|
||||
/// <summary>
|
||||
/// Id de l'album.
|
||||
/// </summary>
|
||||
[JsonPropertyName("id")]
|
||||
public string Id { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Nom de l'album.
|
||||
/// </summary>
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Date de sortie.
|
||||
/// </summary>
|
||||
[JsonPropertyName("release_date")]
|
||||
public string? ReleaseDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Urls de la jaquette.
|
||||
/// </summary>
|
||||
[JsonPropertyName("images")]
|
||||
public List<SpotifyImageDto> Images { get; set; } = new ();
|
||||
}
|
||||
}
|
||||
16
Webzine.Business/DTOs/Spotify/SpotifyAlbumsResponseDto.cs
Normal file
16
Webzine.Business/DTOs/Spotify/SpotifyAlbumsResponseDto.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
namespace Webzine.Business.DTOs.Spotify
|
||||
{
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
/// <summary>
|
||||
/// Objet Spotify qui contient une liste d'album.
|
||||
/// </summary>
|
||||
public class SpotifyAlbumsResponseDto
|
||||
{
|
||||
/// <summary>
|
||||
/// Container de plusieurs albums spotify.
|
||||
/// </summary>
|
||||
[JsonPropertyName("items")]
|
||||
public List<SpotifyAlbumDto> Items { get; set; } = new ();
|
||||
}
|
||||
}
|
||||
28
Webzine.Business/DTOs/Spotify/SpotifyArtistDto.cs
Normal file
28
Webzine.Business/DTOs/Spotify/SpotifyArtistDto.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
namespace Webzine.Business.DTOs.Spotify
|
||||
{
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
/// <summary>
|
||||
/// Objet artiste retourne depuis spotify.
|
||||
/// </summary>
|
||||
public class SpotifyArtistDto
|
||||
{
|
||||
/// <summary>
|
||||
/// Id de l'artiste.
|
||||
/// </summary>
|
||||
[JsonPropertyName("id")]
|
||||
public string Id { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Nom de l'artiste.
|
||||
/// </summary>
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Genre musical de l'artiste.
|
||||
/// </summary>
|
||||
[JsonPropertyName("genres")]
|
||||
public List<string> Genres { get; set; } = new ();
|
||||
}
|
||||
}
|
||||
16
Webzine.Business/DTOs/Spotify/SpotifyArtistsContainerDto.cs
Normal file
16
Webzine.Business/DTOs/Spotify/SpotifyArtistsContainerDto.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
namespace Webzine.Business.DTOs.Spotify
|
||||
{
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
/// <summary>
|
||||
/// Container d'artistes spotify.
|
||||
/// </summary>
|
||||
public class SpotifyArtistsContainerDto
|
||||
{
|
||||
/// <summary>
|
||||
/// Liste d'artiste spotify.
|
||||
/// </summary>
|
||||
[JsonPropertyName("items")]
|
||||
public List<SpotifyArtistDto> Items { get; set; } = new ();
|
||||
}
|
||||
}
|
||||
9
Webzine.Business/DTOs/Spotify/SpotifyExternalUrlsDto.cs
Normal file
9
Webzine.Business/DTOs/Spotify/SpotifyExternalUrlsDto.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace Webzine.Business.DTOs.Spotify;
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
public class SpotifyExternalUrlsDto
|
||||
{
|
||||
[JsonPropertyName("spotify")]
|
||||
public string? Spotify { get; set; }
|
||||
}
|
||||
9
Webzine.Business/DTOs/Spotify/SpotifyImageDto.cs
Normal file
9
Webzine.Business/DTOs/Spotify/SpotifyImageDto.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace Webzine.Business.DTOs.Spotify;
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
public class SpotifyImageDto
|
||||
{
|
||||
[JsonPropertyName("url")]
|
||||
public string? Url { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
namespace Webzine.Business.DTOs.Spotify
|
||||
{
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
/// <summary>
|
||||
/// Resultat d'une recherche spotify avec un objet artist.
|
||||
/// </summary>
|
||||
public class SpotifySearchArtistsResponseDto
|
||||
{
|
||||
/// <summary>
|
||||
/// Liste d'artistes.
|
||||
/// </summary>
|
||||
[JsonPropertyName("artists")]
|
||||
public SpotifyArtistsContainerDto? Artists { get; set; }
|
||||
}
|
||||
}
|
||||
16
Webzine.Business/DTOs/Spotify/SpotifyTokenResponseDto.cs
Normal file
16
Webzine.Business/DTOs/Spotify/SpotifyTokenResponseDto.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
namespace Webzine.Business.DTOs.Spotify
|
||||
{
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
/// <summary>
|
||||
/// Recuperation Token Bearer de spotify.
|
||||
/// </summary>
|
||||
public class SpotifyTokenResponseDto
|
||||
{
|
||||
/// <summary>
|
||||
/// Jeton d'acces.
|
||||
/// </summary>
|
||||
[JsonPropertyName("access_token")]
|
||||
public string? AccessToken { get; set; }
|
||||
}
|
||||
}
|
||||
34
Webzine.Business/DTOs/Spotify/SpotifyTrackDto.cs
Normal file
34
Webzine.Business/DTOs/Spotify/SpotifyTrackDto.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
namespace Webzine.Business.DTOs.Spotify
|
||||
{
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
/// <summary>
|
||||
/// Objet track de spotify.
|
||||
/// </summary>
|
||||
public class SpotifyTrackDto
|
||||
{
|
||||
/// <summary>
|
||||
/// Id de la track.
|
||||
/// </summary>
|
||||
[JsonPropertyName("id")]
|
||||
public string Id { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Nom de la musique.
|
||||
/// </summary>
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Duree de la musique en millieseconde.
|
||||
/// </summary>
|
||||
[JsonPropertyName("duration_ms")]
|
||||
public int DurationMs { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// urls spotify.
|
||||
/// </summary>
|
||||
[JsonPropertyName("external_urls")]
|
||||
public SpotifyExternalUrlsDto? ExternalUrls { get; set; }
|
||||
}
|
||||
}
|
||||
16
Webzine.Business/DTOs/Spotify/SpotifyTracksResponseDto.cs
Normal file
16
Webzine.Business/DTOs/Spotify/SpotifyTracksResponseDto.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
namespace Webzine.Business.DTOs.Spotify
|
||||
{
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
/// <summary>
|
||||
/// Reponse spotify qui contient une liste de tracks.
|
||||
/// </summary>
|
||||
public class SpotifyTracksResponseDto
|
||||
{
|
||||
/// <summary>
|
||||
/// Container qui contient plusieurs tracks.
|
||||
/// </summary>
|
||||
[JsonPropertyName("items")]
|
||||
public List<SpotifyTrackDto> Items { get; set; } = new ();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user