diff --git a/BBWY.Server.Business/PlatformSDK/JDBusiness.cs b/BBWY.Server.Business/PlatformSDK/JDBusiness.cs index d84ef6ed..56d47a2c 100644 --- a/BBWY.Server.Business/PlatformSDK/JDBusiness.cs +++ b/BBWY.Server.Business/PlatformSDK/JDBusiness.cs @@ -85,7 +85,7 @@ namespace BBWY.Server.Business orderType = "desc", pageSize = searchProductRequest.PageSize, pageNo = searchProductRequest.PageIndex, - field = "created" + field = "created,logo" }; if (!string.IsNullOrEmpty(searchProductRequest.Spu)) req_productList.wareId = searchProductRequest.Spu; @@ -109,7 +109,8 @@ namespace BBWY.Server.Business Title = p.Value("title"), ProductItemNum = p.Value("itemNum"), State = p.Value("wareStatus"), - CreateTime = p.Value("created").StampToDateTime() + CreateTime = p.Value("created").StampToDateTime(), + Logo = $"https://img13.360buyimg.com/n9/s100x100_{p.Value("logo")}" }).ToList() }; } diff --git a/BBWY.Server.Model/Dto/Response/Product/ProductResponse.cs b/BBWY.Server.Model/Dto/Response/Product/ProductResponse.cs index 4d9ad01a..aa181f26 100644 --- a/BBWY.Server.Model/Dto/Response/Product/ProductResponse.cs +++ b/BBWY.Server.Model/Dto/Response/Product/ProductResponse.cs @@ -28,6 +28,8 @@ namespace BBWY.Server.Model.Dto public int State { get; set; } public DateTime? CreateTime { get; set; } + + public string Logo { get; set; } } public class ProductListResponse diff --git a/BBWY.Test/JDProductAPITest.cs b/BBWY.Test/JDProductAPITest.cs index 917b9595..12ab8fbd 100644 --- a/BBWY.Test/JDProductAPITest.cs +++ b/BBWY.Test/JDProductAPITest.cs @@ -402,5 +402,36 @@ namespace BBWY.Test Console.WriteLine(JsonConvert.SerializeObject(res)); } + + public void QuerySPU(IJdClient client,string token) + { + var req_productList = new WareReadSearchWare4ValidRequest() + { + orderField = "modified", + orderType = "desc", + pageSize = 50, + pageNo = 1, + field = "created,logo" + }; + + req_productList.wareId = "10023015553755"; + + var res = client.Execute(req_productList, token, DateTime.Now.ToLocalTime()); + + Console.WriteLine(JsonConvert.SerializeObject(res)); + + //return new ProductListResponse() + //{ + // Count = rep_productList.page.totalItem, + // Items = ((JArray)rep_productList.Json["jingdong_ware_read_searchWare4Valid_responce"]["page"]["data"]).Select(p => new ProductResponse() + // { + // Id = p.Value("wareId"), + // Title = p.Value("title"), + // ProductItemNum = p.Value("itemNum"), + // State = p.Value("wareStatus"), + // CreateTime = p.Value("created").StampToDateTime() + // }).ToList() + //}; + } } } diff --git a/BBWY.Test/Program.cs b/BBWY.Test/Program.cs index d85a0af1..f3685feb 100644 --- a/BBWY.Test/Program.cs +++ b/BBWY.Test/Program.cs @@ -39,7 +39,7 @@ namespace BBWY.Test //10022515718131 需要进行赠品上架的SPU IJdClient client = GetJdClient(appkey, appSecret); var test1 = new JDProductAPITest(); - test1.QueryOrderCount(client, token); + test1.QuerySPU(client, token); //test1.ShangJiaTest(client, token); //test1.修改属性别名(client, token);