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.
66 lines
2.4 KiB
66 lines
2.4 KiB
using Jd.Api;
|
|
using Newtonsoft.Json.Linq;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
namespace BBWY.Test
|
|
{
|
|
internal class Program
|
|
{
|
|
private static IJdClient GetJdClient(string appKey, string appSecret)
|
|
{
|
|
return new DefaultJdClient("https://api.jd.com/routerjson", appKey, appSecret);
|
|
}
|
|
|
|
static void Main(string[] args)
|
|
{
|
|
var appkey = "120EA9EC65AB017567D78CC1139EEEA5";
|
|
var appSecret = "8a42bc2301e8439b896e99f5475e0a9b";
|
|
//0e61c4a8ec3e4df4b5836e10884db9220yth 齐盛
|
|
//2ace3023200c4ea9aa682bbf8bffee18jztm 布莱特玩具
|
|
var token = "0e61c4a8ec3e4df4b5836e10884db9220yth"; //"b46065ef5b894f2297686e28d39cb37a2mdy";//"";
|
|
|
|
//var path = @"C:\Users\pengcong001\Desktop\含赠品SKU.txt";
|
|
//var j = JToken.Parse(System.IO.File.ReadAllText(path, System.Text.Encoding.UTF8));
|
|
//var firstJ = j["Json"]["jingdong_sku_read_searchSkuList_responce"]["page"]["data"].Children().FirstOrDefault();
|
|
//var saleAtters = firstJ.Value<JArray>("saleAttrs").Select(s => new
|
|
//{
|
|
// attrId = s.Value<string>("attrId"),
|
|
// attrValues = s.Value<JArray>("attrValues").Select(x => x.ToString()).ToList()
|
|
//}).ToList();
|
|
|
|
|
|
//10023500913672 含赠品SPU
|
|
//10022515718131 需要进行赠品上架的SPU
|
|
IJdClient client = GetJdClient(appkey, appSecret);
|
|
var test1 = new JDProductAPITest();
|
|
|
|
//Console.WriteLine("-------------获取包含赠品的sku-------------");
|
|
//test1.GetSkus(client,token, "10023500913672");
|
|
|
|
|
|
//Console.WriteLine("-------------获取需要进行赠品SKU上架的本款产品的sku-------------");
|
|
|
|
//test1.GetSkus(client, token, "10022515718131");
|
|
|
|
//Console.WriteLine("-------------查询本款产品透图-------------");
|
|
|
|
//test1.QueryTouTu(client,token, "10022515718131");
|
|
|
|
//Console.WriteLine("-------------查询本款产品细节图-------------");
|
|
|
|
//test1.FindImageByColor(client, token, "10022515718131");
|
|
|
|
//var testService = new JDServiceAPITest();
|
|
//testService.GetServiceDetail(client, token);
|
|
|
|
//var ddTest = new DingDingAPITest();
|
|
//ddTest.Send();
|
|
|
|
test1.ShangJiaTest(client, token);
|
|
|
|
Console.ReadKey();
|
|
}
|
|
}
|
|
}
|
|
|