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.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

StatsClientService.cs 651B

12345678910111213141516171819202122
  1. using Grpc.Net.Client;
  2. using GrpcShared.DTO;
  3. using GrpcShared.DTO.Track;
  4. using GrpcShared.Interfaces;
  5. using NemAnBlazor.Services.Interfaces;
  6. using ProtoBuf.Grpc.Client;
  7. namespace NemAnBlazor.Services
  8. {
  9. public class StatsClientService : IStatsClientService
  10. {
  11. private IStatsService _serviceClient;
  12. public StatsClientService(GrpcChannel channel)
  13. {
  14. _serviceClient = channel.CreateGrpcService<IStatsService>();
  15. }
  16. public async Task<TrackResponse> GetCurrentlyPlayingTrack(TokenMessage token)
  17. {
  18. return await _serviceClient.GetCurrentlyPlayingTrack(token);
  19. }
  20. }
  21. }