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.

91 lines
5.0 KiB

2 years ago
using BBWYB.Client.Models;
2 years ago
using BBWYB.Common.Http;
using BBWYB.Common.Models;
2 years ago
using System.Collections.Generic;
using System.Net.Http;
2 years ago
namespace BBWYB.Client.APIServices
2 years ago
{
public class ProductService : BaseApiService, IDenpendency
{
public ProductService(RestApiService restApiService, GlobalContext globalContext) : base(restApiService, globalContext) { }
2 years ago
public ApiResponse<ProductListResponse> GetProductList(string spu, string productName, string productItem, int pageIndex, int pageSize)
2 years ago
{
2 years ago
return SendRequest<ProductListResponse>(globalContext.BBWYApiHost,
2 years ago
"api/product/GetProductList",
new
{
2 years ago
spu,
productName,
productItem,
pageIndex,
pageSize,
globalContext.User.Shop.Platform,
globalContext.User.Shop.AppKey,
globalContext.User.Shop.AppSecret,
globalContext.User.Shop.AppToken
2 years ago
},
null,
HttpMethod.Post);
}
2 years ago
public ApiResponse<ProductSkuListResponse> GetProductSkuList(string spu, string sku)
2 years ago
{
2 years ago
return SendRequest<ProductSkuListResponse>(globalContext.BBWYApiHost,
2 years ago
"api/product/GetProductSkuList",
new
{
Spu = spu,
Sku = sku,
2 years ago
globalContext.User.Shop.Platform,
globalContext.User.Shop.AppKey,
globalContext.User.Shop.AppSecret,
globalContext.User.Shop.AppToken
2 years ago
},
null,
HttpMethod.Post);
}
2 years ago
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);
}
//
2 years ago
}
2 years ago
2 years ago
2 years ago
}