You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
814 B

using BBWYB.Common.Http;
using BBWYB.Common.Models;
using SDKAdapter.PurchasePlatform.Models;
namespace SDKAdapter.OperationPlatform.Client
{
public class OP_PlatformClientFactory
{
private IList<OP_PlatformClient> clients;
public OP_PlatformClientFactory(RestApiService restApiService)
{
clients = new List<OP_PlatformClient>();
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;
}
}
}