PerformanceItemServices.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. using Microsoft.AspNetCore.Components.Authorization;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Net.Http;
  6. using System.Net.Http.Json;
  7. using System.Threading.Tasks;
  8. using wispro.sp.entity;
  9. using wispro.sp.share;
  10. using wispro.sp.web.Auth;
  11. namespace wispro.sp.web.Services
  12. {
  13. public class PerformanceItemServices
  14. {
  15. private readonly HttpClient _httpClient;
  16. private readonly JwtAuthenticationStateProvider _jwt;
  17. public PerformanceItemServices(HttpClient httpClient, AuthenticationStateProvider jwt)
  18. {
  19. _httpClient = httpClient;
  20. _jwt = (JwtAuthenticationStateProvider)jwt;
  21. }
  22. public async Task<ListApiResponse<PerformanceItem>> GetItems(int _pageIndex,int _pageSize)
  23. {
  24. ListApiResponse<PerformanceItem> data = await _httpClient.GetFromJsonAsync<ListApiResponse<PerformanceItem>>($"http://localhost:39476/api/PerformanceItem/Query?pageIndex={_pageIndex}&pageSize={_pageSize}");
  25. return data;
  26. }
  27. }
  28. }