using BBWYB.Common.Http; using BBWYB.Common.Models; using SDKAdapter.PurchasePlatform.Models; namespace SDKAdapter.OperationPlatform.Client { public class OP_PlatformClientFactory { private IList clients; public OP_PlatformClientFactory(RestApiService restApiService) { clients = new List(); clients.Add(new OP_JDClient(restApiService)); clients.Add(new OP_QuanTanClient(restApiService)); } public OP_PlatformClient GetClient(AdapterEnums.PlatformType platform) { var client = clients.FirstOrDefault(c => c.Platform == platform); if (client == null) throw new Exception("不支持的平台"); return client; } } }