Blazor & WASM in combination to get statistics from Spotify API for performing the song analysis. With separate microservices for auth, Spotify, user data tracking, and application, connected through gRPC with Polly.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

StatsClientService.cs 852B

12345678910111213141516171819202122232425262728
  1. using Grpc.Net.Client;
  2. using GrpcShared.DTO;
  3. using GrpcShared.DTO.TopItem;
  4. using GrpcShared.DTO.Track;
  5. using GrpcShared.Interfaces;
  6. using NemAnBlazor.Services.Interfaces;
  7. using ProtoBuf.Grpc.Client;
  8. namespace NemAnBlazor.Services
  9. {
  10. public class StatsClientService : IStatsClientService
  11. {
  12. private IStatsService _serviceClient;
  13. public StatsClientService(GrpcChannel channel)
  14. {
  15. _serviceClient = channel.CreateGrpcService<IStatsService>();
  16. }
  17. public async Task<CurrentTrackResponse> GetCurrentlyPlayingTrack(SessionMessage message)
  18. {
  19. return await _serviceClient.GetCurrentlyPlayingTrack(message);
  20. }
  21. public async Task<TopItemResponse> GetTopItems(TopItemRequest request)
  22. {
  23. return await _serviceClient.GetTopItems(request);
  24. }
  25. }
  26. }