|
|
@ -30,40 +30,41 @@ namespace BBWY.Test |
|
|
|
var token = "2ace3023200c4ea9aa682bbf8bffee18jztm"; |
|
|
|
var jdClient = GetJdClient(appKey, appSecret); |
|
|
|
|
|
|
|
SearchProductSkuRequest searchProductRequest = new SearchProductSkuRequest() |
|
|
|
{ |
|
|
|
AppKey = appKey, |
|
|
|
AppSecret = appSecret, |
|
|
|
AppToken = token, |
|
|
|
Platform = Server.Model.Enums.Platform.京东, |
|
|
|
Spu = "10022849663452" |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
AscQueryListRequest req = new AscQueryListRequest(); |
|
|
|
//var jdClient = GetJdClient(searchProductRequest.AppKey, searchProductRequest.AppSecret);
|
|
|
|
var req_skuList = new SkuReadSearchSkuListRequest() |
|
|
|
{ |
|
|
|
pageSize = 50,//50
|
|
|
|
field = "logo,saleAttrs,status" |
|
|
|
}; |
|
|
|
|
|
|
|
req.buId = "10598776"; |
|
|
|
req.operatePin = "开发测试"; |
|
|
|
req.operateNick = "开发测试"; |
|
|
|
req.orderId = 239918499544; |
|
|
|
if (!string.IsNullOrEmpty(searchProductRequest.Spu)) |
|
|
|
req_skuList.wareId = searchProductRequest.Spu; |
|
|
|
else if (!string.IsNullOrEmpty(searchProductRequest.Sku)) |
|
|
|
req_skuList.skuId = searchProductRequest.Sku; |
|
|
|
|
|
|
|
//req.finishTimeBegin = DateTime.Now.AddDays(-30);
|
|
|
|
//req.finishTimeEnd = DateTime.Now;
|
|
|
|
//req.pageNumber = "1";
|
|
|
|
//req.pageSize = "20";
|
|
|
|
//req.orderId = 164569571399;
|
|
|
|
//req.serviceId = 123L;
|
|
|
|
//req.orderId = 123L;
|
|
|
|
//req.applyTimeBegin = new Date();
|
|
|
|
//req.applyTimeEnd = new Date();
|
|
|
|
//req.finishTimeBegin = new Date();
|
|
|
|
//req.finishTimeEnd = new Date();
|
|
|
|
//req.verificationCode = "abc";
|
|
|
|
//req.expressCode = "abc";
|
|
|
|
//req.orderType = 123;
|
|
|
|
//req.processResult = 123;
|
|
|
|
//req.customerPin = "abc";
|
|
|
|
//req.customerName = "abc";
|
|
|
|
//req.customerTel = "abc";
|
|
|
|
//req.approveTimeBegin = new Date();
|
|
|
|
//req.approveTimeEnd = new Date();
|
|
|
|
//req.pageNumber = 123;
|
|
|
|
//req.pageSize = 123;
|
|
|
|
//req.extJsonStr = "abc";
|
|
|
|
var rep_skuList = jdClient.Execute(req_skuList, searchProductRequest.AppToken, DateTime.Now.ToLocalTime()); |
|
|
|
if (rep_skuList.IsError) |
|
|
|
throw new BusinessException(string.IsNullOrEmpty(rep_skuList.ErrorMsg) ? rep_skuList.ErrMsg : rep_skuList.ErrorMsg); |
|
|
|
var response = ((JArray)rep_skuList.Json["jingdong_sku_read_searchSkuList_responce"]["page"]["data"]).Select(s => new ProductSkuResponse() |
|
|
|
{ |
|
|
|
Id = s.Value<string>("skuId"), |
|
|
|
ProductId = s.Value<string>("wareId"), |
|
|
|
Price = s.Value<decimal>("jdPrice"), |
|
|
|
Title = string.Join("-", s["saleAttrs"].Select(a => a["attrValueAlias"][0].ToString())), |
|
|
|
Logo = $"https://img13.360buyimg.com/n9/s80x80_{s.Value<string>("logo")}", |
|
|
|
State = s.Value<int>("status") |
|
|
|
}).ToList(); |
|
|
|
|
|
|
|
AscQueryListResponse response = jdClient.Execute(req, token, DateTime.Now.ToLocalTime()); |
|
|
|
Console.WriteLine(JsonConvert.SerializeObject(response)); |
|
|
|
Console.ReadKey(); |
|
|
|
} |
|
|
|