using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XYY.Model.Standard.Channel;

namespace XYY.Service.Standard.Channel
{
    public static class ChannelClientService
    {
        const string Token = "132A7468DE079C6CEB59F383A661E612";
        const string ApiHost = "http://wms.xingyunyi.cn";
        public static async Task<IEnumerable<Logistics_Public>> CacheGetAllPublic()
        { 
            RestSharp.RestClient restClient = new RestSharp.RestClient(ApiHost);
            RestSharp.RestRequest restRequest = new RestSharp.RestRequest("/api/BaseInfo/CacheGetAllPublicChannel");
            restRequest.AddHeader("token", Token);
            var response = await restClient.ExecuteAsync<IEnumerable<Logistics_Public>>(restRequest);
            IEnumerable<Logistics_Public> result = response.Data; 
            return result;
        }
        public static async Task<IEnumerable<Logistics_Channel>> CacheGetAllChannel()
        {
            RestSharp.RestClient restClient = new RestSharp.RestClient(ApiHost);
            RestSharp.RestRequest restRequest = new RestSharp.RestRequest("/api/BaseInfo/CacheGetAllChannel");
            restRequest.AddHeader("token", Token);
            var response = await restClient.ExecuteAsync<IEnumerable<Logistics_Channel>>(restRequest);
            IEnumerable<Logistics_Channel> result = response.Data; 
            return result; 
        }
    }


}
