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文字以内のものにしてください。

Home.razor 1.0KB

123456789101112131415161718192021222324252627
  1. @page "/home"
  2. @using GrpcShared.DTO
  3. @using GrpcShared.DTO.Track
  4. @using NemAnBlazor.Services.Interfaces
  5. @inject Blazored.SessionStorage.ISessionStorageService sessionStorage
  6. @inject IStatsClientService spotifyService
  7. @inject ITrackClientService trackService
  8. <h3>Home</h3>
  9. <p>login radi</p>
  10. @code {
  11. protected override async Task OnInitializedAsync()
  12. {
  13. string tokenS = await sessionStorage.GetItemAsync<string>("token");
  14. TokenMessage token = new TokenMessage{Token = tokenS};
  15. CurrentTrackResponse response = await spotifyService.GetCurrentlyPlayingTrack(token);
  16. //napravi komponentu koja ce da prikazuje sta trenutno slusas i passuj joj parametre
  17. //4fy1A2WBTPX55mUI16TQXa
  18. //var trackById = await trackService.GetById(new GrpcShared.DTO.TrackByID.TrackRequest { TrackID = "4fy1A2WBTPX55mUI16TQXa", Token = tokenS });
  19. var items = await spotifyService.GetTopItems(new GrpcShared.DTO.TopItem.TopItemRequest { Token = tokenS, IsTracks = false, Offset = 5});
  20. }
  21. }