コード例 #1
0
 public PartyHub(IPartyService partyService, ISpotifyHttpClient spotifyHttpClient, ILogService logService, IPartyGoerService partyGoerService, IPartyGoerSettingsService partyGoerSettingsService)
 {
     _partyService             = partyService;
     _spotifyHttpClient        = spotifyHttpClient;
     _logService               = logService;
     _partyGoerService         = partyGoerService;
     _partyGoerSettingsService = partyGoerSettingsService;
 }
コード例 #2
0
 public SpotifyHttpClient(ISpotifyAuthentication spotifyAuthentication, IHttpClient httpClient, ILogService logService, IPartyGoerSettingsService partyGoerSettingsService)
 {
     _httpClient               = httpClient;
     _spotifyAuthentication    = spotifyAuthentication;
     _logService               = logService;
     _partyGoerSettingsService = partyGoerSettingsService;
     _apiEndpoints             = new Dictionary <ApiEndpointType, SpotifyEndpoint>
     {
         { ApiEndpointType.CurrentSong, new SpotifyEndpoint {
               EndpointUrl = "https://api.spotify.com/v1/me/player/currently-playing", HttpMethod = HttpMethod.Get
           } },
         { ApiEndpointType.PlaySong, new SpotifyEndpoint {
               EndpointUrl = "https://api.spotify.com/v1/me/player/play", HttpMethod = HttpMethod.Put
           } },
         { ApiEndpointType.Token, new SpotifyEndpoint {
               EndpointUrl = "https://accounts.spotify.com/api/token", HttpMethod = HttpMethod.Post
           } },
         { ApiEndpointType.UserInformation, new SpotifyEndpoint {
               EndpointUrl = "https://api.spotify.com/v1/me", HttpMethod = HttpMethod.Get
           } },
         { ApiEndpointType.GetTopTracks, new SpotifyEndpoint {
               EndpointUrl = "https://api.spotify.com/v1/me/top/tracks", HttpMethod = HttpMethod.Get
           } },
         { ApiEndpointType.GetRecommendedTracks, new SpotifyEndpoint {
               EndpointUrl = "https://api.spotify.com/v1/recommendations", HttpMethod = HttpMethod.Get
           } },
         { ApiEndpointType.GetUserDevices, new SpotifyEndpoint {
               EndpointUrl = "https://api.spotify.com/v1/me/player/devices", HttpMethod = HttpMethod.Get
           } },
         { ApiEndpointType.SearchSpotify, new SpotifyEndpoint {
               EndpointUrl = "https://api.spotify.com/v1/search", HttpMethod = HttpMethod.Get
           } },
         { ApiEndpointType.PausePlayback, new SpotifyEndpoint {
               EndpointUrl = "https://api.spotify.com/v1/me/player/pause", HttpMethod = HttpMethod.Put
           } }
     };
 }