| @@ -9,7 +9,7 @@ using System.Threading.Tasks; | |||
| namespace GrpcShared.Interfaces | |||
| { | |||
| [Service] | |||
| public interface ISearchService | |||
| public interface ITrackService | |||
| { | |||
| Task<SearchResponse> ListSearchAsync(SearchRequest request); | |||
| } | |||
| @@ -69,7 +69,7 @@ app.MapControllers(); | |||
| //app.MapGrpcService<WeatherService>(); | |||
| app.MapGrpcService<AuthService>().EnableGrpcWeb(); | |||
| app.MapGrpcService<SearchService>().EnableGrpcWeb(); | |||
| app.MapGrpcService<TrackService>().EnableGrpcWeb(); | |||
| app.MapCodeFirstGrpcReflectionService(); | |||
| @@ -3,7 +3,7 @@ | |||
| @using NemAnBlazor.Services.Interfaces | |||
| @*@inject HttpClient Http*@ | |||
| @inject Blazored.SessionStorage.ISessionStorageService sessionStorage | |||
| @inject ISearchClientService SearchService | |||
| @inject ITrackClientService SearchService | |||
| <PageTitle>Search</PageTitle> | |||
| @@ -7,7 +7,7 @@ | |||
| @using NemAnBlazor.Services.Interfaces | |||
| @inject NavigationManager NavigationManager | |||
| @inject IAuthClientService AuthService | |||
| @inject ISearchClientService SearchService | |||
| @inject ITrackClientService SearchService | |||
| <PageTitle>Index</PageTitle> | |||
| <h1>Pozdrav Diligent!</h1> | |||
| @@ -22,7 +22,7 @@ builder.Services.AddScoped(_ => | |||
| return channel; | |||
| }); | |||
| builder.Services.AddScoped<ISearchClientService, SearchClientService>(); | |||
| builder.Services.AddScoped<ITrackClientService, TrackClientService>(); | |||
| builder.Services.AddScoped<IAuthClientService, AuthClientService>(); | |||
| builder.Services.AddBlazoredSessionStorage(); | |||
| @@ -2,7 +2,7 @@ | |||
| namespace NemAnBlazor.Services.Interfaces | |||
| { | |||
| public interface ISearchClientService | |||
| public interface ITrackClientService | |||
| { | |||
| Task<SearchResponse> GetListSearchAsync(SearchRequest request); | |||
| } | |||
| @@ -6,13 +6,13 @@ using ProtoBuf.Grpc.Client; | |||
| namespace NemAnBlazor.Services | |||
| { | |||
| public class SearchClientService : ISearchClientService | |||
| public class TrackClientService : ITrackClientService | |||
| { | |||
| private ISearchService _serviceClient; | |||
| private ITrackService _serviceClient; | |||
| public SearchClientService(GrpcChannel grpcChannel) | |||
| public TrackClientService(GrpcChannel grpcChannel) | |||
| { | |||
| _serviceClient = grpcChannel.CreateGrpcService<ISearchService>(); | |||
| _serviceClient = grpcChannel.CreateGrpcService<ITrackService>(); | |||
| } | |||
| public async Task<SearchResponse> GetListSearchAsync(SearchRequest request) | |||
| @@ -9,12 +9,12 @@ using System.Text.Json; | |||
| namespace SpotifyService.Services | |||
| { | |||
| public class SearchService : ISearchService | |||
| public class TrackService : ITrackService | |||
| { | |||
| private readonly IHttpClientFactory _httpClientFactory; | |||
| public SearchService(IHttpClientFactory httpClientFactory) | |||
| public TrackService(IHttpClientFactory httpClientFactory) | |||
| { | |||
| _httpClientFactory = httpClientFactory; | |||
| } | |||
| @@ -27,7 +27,6 @@ namespace SpotifyService.Services | |||
| var searchResult = await client.GetAsync($"search?q={request.Query}&type={request.Type}"); | |||
| var responses = JsonConvert.DeserializeObject<SearchResponse>(await searchResult.Content.ReadAsStringAsync())!; | |||
| return new SearchResponse | |||