IChannelClientService.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using XYY.Model.Standard.Channel;
  7. namespace XYY.Service.Standard.Channel
  8. {
  9. public static class ChannelClientService
  10. {
  11. const string Token = "132A7468DE079C6CEB59F383A661E612";
  12. const string ApiHost = "http://wms.xingyunyi.cn";
  13. public static async Task<IEnumerable<Logistics_Public>> CacheGetAllPublic()
  14. {
  15. RestSharp.RestClient restClient = new RestSharp.RestClient(ApiHost);
  16. RestSharp.RestRequest restRequest = new RestSharp.RestRequest("/api/BaseInfo/CacheGetAllPublicChannel");
  17. restRequest.AddHeader("token", Token);
  18. var response = await restClient.ExecuteAsync<IEnumerable<Logistics_Public>>(restRequest);
  19. IEnumerable<Logistics_Public> result = response.Data;
  20. return result;
  21. }
  22. public static async Task<IEnumerable<Logistics_Channel>> CacheGetAllChannel()
  23. {
  24. RestSharp.RestClient restClient = new RestSharp.RestClient(ApiHost);
  25. RestSharp.RestRequest restRequest = new RestSharp.RestRequest("/api/BaseInfo/CacheGetAllChannel");
  26. restRequest.AddHeader("token", Token);
  27. var response = await restClient.ExecuteAsync<IEnumerable<Logistics_Channel>>(restRequest);
  28. IEnumerable<Logistics_Channel> result = response.Data;
  29. return result;
  30. }
  31. }
  32. }