using BBWYB.Common.Http;

namespace SDKAdapter.PurchasePlatform.Client
{
    public class PP_PlatformClientFactory
    {
        private IList<PP_PlatformClient> clients;

        public PP_PlatformClientFactory(RestApiService restApiService)
        {
            clients = new List<PP_PlatformClient>();
            clients.Add(new PP_1688Client(restApiService));
        }

        public PP_PlatformClient GetClient(AdapterEnums.PlatformType platform)
        {
            var client = clients.FirstOrDefault(c => c.Platform == platform);
            if (client == null)
                throw new Exception("不支持的平台");
            return client;
        }
    }
}