|
|
|
using BBWYB.Client.Models;
|
|
|
|
using BBWYB.Common.Http;
|
|
|
|
using BBWYB.Common.Models;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Net.Http;
|
|
|
|
|
|
|
|
namespace BBWYB.Client.APIServices
|
|
|
|
{
|
|
|
|
public class ProductService : BaseApiService, IDenpendency
|
|
|
|
{
|
|
|
|
public ProductService(RestApiService restApiService, GlobalContext globalContext) : base(restApiService, globalContext) { }
|
|
|
|
|
|
|
|
public ApiResponse<ProductListResponse> GetProductList(string spu, string productName, string productItem, int pageIndex, int pageSize)
|
|
|
|
{
|
|
|
|
return SendRequest<ProductListResponse>(globalContext.BBWYApiHost,
|
|
|
|
"api/product/GetProductList",
|
|
|
|
new
|
|
|
|
{
|
|
|
|
spu,
|
|
|
|
productName,
|
|
|
|
productItem,
|
|
|
|
pageIndex,
|
|
|
|
pageSize,
|
|
|
|
globalContext.User.Shop.Platform,
|
|
|
|
globalContext.User.Shop.AppKey,
|
|
|
|
globalContext.User.Shop.AppSecret,
|
|
|
|
globalContext.User.Shop.AppToken
|
|
|
|
},
|
|
|
|
null,
|
|
|
|
HttpMethod.Post);
|
|
|
|
}
|
|
|
|
|
|
|
|
public ApiResponse<ProductSkuListResponse> GetProductSkuList(string spu, string sku)
|
|
|
|
{
|
|
|
|
return SendRequest<ProductSkuListResponse>(globalContext.BBWYApiHost,
|
|
|
|
"api/product/GetProductSkuList",
|
|
|
|
new
|
|
|
|
{
|
|
|
|
Spu = spu,
|
|
|
|
Sku = sku,
|
|
|
|
globalContext.User.Shop.Platform,
|
|
|
|
globalContext.User.Shop.AppKey,
|
|
|
|
globalContext.User.Shop.AppSecret,
|
|
|
|
globalContext.User.Shop.AppToken
|
|
|
|
},
|
|
|
|
null,
|
|
|
|
HttpMethod.Post);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public ApiResponse<ProductListResponse> GetProductList(string spu, string productName, string productItem, int pageIndex, Platform platform, string appKey, string appSecret, string appToken)
|
|
|
|
{
|
|
|
|
return SendRequest<ProductListResponse>(globalContext.BBWYCApiHost,
|
|
|
|
"api/product/GetProductList",
|
|
|
|
new
|
|
|
|
{
|
|
|
|
Spu = spu,
|
|
|
|
ProductName = productName,
|
|
|
|
ProductItem = productItem,
|
|
|
|
PageIndex = pageIndex,
|
|
|
|
Platform = platform,
|
|
|
|
AppKey = appKey,
|
|
|
|
AppSecret = appSecret,
|
|
|
|
AppToken = appToken
|
|
|
|
},
|
|
|
|
null,
|
|
|
|
HttpMethod.Post);
|
|
|
|
}
|
|
|
|
|
|
|
|
public ApiResponse<IList<ProductSku>> GetProductSkuList(string spu, string sku, Platform platform, string appKey, string appSecret, string appToken)
|
|
|
|
{
|
|
|
|
return SendRequest<IList<ProductSku>>(globalContext.BBWYCApiHost,
|
|
|
|
"api/product/GetProductSkuList",
|
|
|
|
new
|
|
|
|
{
|
|
|
|
Spu = spu,
|
|
|
|
Sku = sku,
|
|
|
|
Platform = platform,
|
|
|
|
AppKey = appKey,
|
|
|
|
AppSecret = appSecret,
|
|
|
|
AppToken = appToken
|
|
|
|
},
|
|
|
|
null,
|
|
|
|
HttpMethod.Post);
|
|
|
|
}
|
|
|
|
//
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|