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.

90 lines
3.2 KiB

2 years ago
using BBWYB.Common.Http;
using QuanTan.SDK.Client.Supplier;
using QuanTan.SDK.Models.Supplier;
using SDKAdapter.OperationPlatform.Models;
using SDKAdapter.PurchasePlatform.Models;
namespace SDKAdapter.OperationPlatform.Client
{
public class OP_QuanTanClient : OP_PlatformClient
{
private QuanTan_Supplier_ProductClient supplier_ProductClient;
2 years ago
private QuanTan_Supplier_OrderClient supplier_OrderClient;
2 years ago
public OP_QuanTanClient(RestApiService restApiService) : base(restApiService)
{
this.supplier_ProductClient = new QuanTan_Supplier_ProductClient(restApiService);
}
public override AdapterEnums.PlatformType Platform => AdapterEnums.PlatformType.;
2 years ago
public override OP_ProductListResponse GetProductList(OP_QueryProductRequest request)
2 years ago
{
var qtResponse = supplier_ProductClient.GetProductList(new QuanTan_Supplier_SearchSpuRequest()
{
2 years ago
page = request.PageIndex,
pageSize = request.PageSize,
productId = request.Spu,
storeId = request.AppToken
}, request.AppKey, request.AppSecret);
2 years ago
if (qtResponse.Status != 200)
throw new Exception(qtResponse.Message);
return new OP_ProductListResponse()
{
Count = qtResponse.Data.Count,
Items = qtResponse.Data.List.Select(qtp => new OP_ProductResponse()
{
Id = qtp.ProductId,
BrandName = string.Empty,
CreateTime = null,
Logo = qtp.Image,
ProductItemNum = string.Empty,
State = 0,
Title = qtp.ProductName
}).ToList()
};
}
2 years ago
public override OP_ProductSkuListResponse GetProductSkuList(OP_QueryProductSkuRequest request)
2 years ago
{
var qtResponse = supplier_ProductClient.GetProductSkuList(new QuanTan_Supplier_SearchSkuRequest()
{
2 years ago
page = request.PageIndex,
pageSize = request.PageSize,
storeId = request.AppToken,
productId = request.Spu
}, request.AppKey, request.AppSecret);
2 years ago
if (qtResponse.Status != 200)
throw new Exception(qtResponse.Message);
return new OP_ProductSkuListResponse()
{
Count = qtResponse.Data.Count,
Items = qtResponse.Data.List.Select(qtps => new OP_ProductSkuResponse()
{
CreateTime = null,
Id = qtps.ProductSku,
Logo = qtps.SkuImage,
Price = qtps.SkuPrice,
ProductId = qtps.ProductId,
State = 0,
Title = qtps.SkuName
}).ToList()
};
}
2 years ago
public override OP_OrderListResponse GetOrderList(OP_QueryOrderRequest request)
{
var qtResponse = supplier_OrderClient.GetOrderList(new QuanTan_Supplier_QueryOrderReuqest()
{
storeId = request.AppToken
}, request.AppKey, request.AppSecret);
return base.GetOrderList(request);
}
2 years ago
}
}