shanji 3 years ago
parent
commit
1710301c6f
  1. 62
      BBWY.JDSDK/Request/AdsDspRtbKuaicheAccountCampaignReportRequest.cs
  2. 18
      BBWY.JDSDK/Request/SkuReadSearchSkuListRequest.cs
  3. 3
      BBWY.JDSDK/Response/ActyEnqueryRegistrationDataCountResponse.cs
  4. 15
      BBWY.JDSDK/Response/AdsDspRtbKuaicheAccountCampaignReportResponse.cs
  5. 3
      BBWY.JDSDK/Response/AfsserviceAlltaskGetResponse.cs
  6. 4
      BBWY.Test/BBWY.Test.csproj
  7. 43
      BBWY.Test/Program.cs

62
BBWY.JDSDK/Request/AdsDspRtbKuaicheAccountCampaignReportRequest.cs

@ -0,0 +1,62 @@
using BBWY.JDSDK.Response;
using Jd.Api;
using System;
using System.Collections.Generic;
using System.Text;
namespace BBWY.JDSDK.Request
{
public class AdsDspRtbKuaicheAccountCampaignReportRequest : JdRequestBase<AdsDspRtbKuaicheAccountCampaignReportResponse>
{
public int pageSize { get; set; }
public int page { get; set; }
/// <summary>
/// 当天:0;昨天:1;最近15天:15
/// </summary>
public int clickOrOrderDay { get; set; }
/// <summary>
/// 赠品筛选 0 非赠品 1 赠品
/// </summary>
public int giftFlag { get; set; }
/// <summary>
/// 空:全部订单 1:成交订单
/// </summary>
public Nullable<int> orderStatusCategory { get; set; }
public DateTime endDay { get; set; }
public DateTime startDay { get; set; }
/// <summary>
/// 是否分日 true: 分日 false:不分日
/// </summary>
public bool isDaily { get; set; }
public string platform { get; set; }
/// <summary>
/// 点击口径:0 订单口径:1
/// </summary>
public int clickOrOrderCaliber { get; set; }
public override string ApiName => "jingdong.ads.dsp.rtb.kuaiche.accountCampaignReport";
protected override void PrepareParam(IDictionary<string, object> paramters)
{
paramters.Add("pageSize", pageSize);
paramters.Add("page", page);
paramters.Add("clickOrOrderDay", clickOrOrderDay);
paramters.Add("giftFlag", giftFlag);
paramters.Add("orderStatusCategory", orderStatusCategory);
paramters.Add("endDay", endDay);
paramters.Add("startDay", startDay);
paramters.Add("isDaily", isDaily);
paramters.Add("platform", platform);
paramters.Add("clickOrOrderCaliber", clickOrOrderCaliber);
}
}
}

18
BBWY.JDSDK/Request/SkuReadSearchSkuListRequest.cs

@ -7,11 +7,14 @@ namespace Jd.Api.Request
public class SkuReadSearchSkuListRequest : JdRequestBase<SkuReadSearchSkuListResponse>
{
public string
wareId {get; set; }
wareId
{ get; set; }
public string
skuId {get; set; }
skuId
{ get; set; }
public string
skuStatuValue {get; set; }
skuStatuValue
{ get; set; }
public Nullable<long>
maxStockNum
{ get; set; }
@ -37,7 +40,8 @@ namespace Jd.Api.Request
{ get; set; }
public string
outId {get; set; }
outId
{ get; set; }
public Nullable<int>
colType
{ get; set; }
@ -51,9 +55,11 @@ namespace Jd.Api.Request
{ get; set; }
public string
orderFiled {get; set; }
orderFiled
{ get; set; }
public string
orderType {get; set; }
orderType
{ get; set; }
public Nullable<int>
pageNo
{ get; set; }

3
BBWY.JDSDK/Response/ActyEnqueryRegistrationDataCountResponse.cs

@ -6,7 +6,8 @@ using Newtonsoft.Json;
namespace Jd.Api.Response
{
public class ActyEnqueryRegistrationDataCountResponse:JdResponse{
public class ActyEnqueryRegistrationDataCountResponse : JdResponse
{
[JsonProperty("queryregistrationdatacount_result")]
public ActyResult

15
BBWY.JDSDK/Response/AdsDspRtbKuaicheAccountCampaignReportResponse.cs

@ -0,0 +1,15 @@
using Jd.Api;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Text;
namespace BBWY.JDSDK.Response
{
public class AdsDspRtbKuaicheAccountCampaignReportResponse : JdResponse
{
[JsonProperty("returnType")]
public JObject returnType { get; set; }
}
}

3
BBWY.JDSDK/Response/AfsserviceAlltaskGetResponse.cs

@ -6,7 +6,8 @@ using Newtonsoft.Json;
namespace Jd.Api.Response
{
public class AfsserviceAlltaskGetResponse:JdResponse{
public class AfsserviceAlltaskGetResponse : JdResponse
{
[JsonProperty("publicResultObject5")]
public PublicResultObject5

4
BBWY.Test/BBWY.Test.csproj

@ -9,4 +9,8 @@
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BBWY.JDSDK\BBWY.JDSDK.csproj" />
</ItemGroup>
</Project>

43
BBWY.Test/Program.cs

@ -1,4 +1,7 @@
using Newtonsoft.Json.Linq;
using BBWY.JDSDK.Request;
using Jd.Api;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
@ -13,29 +16,25 @@ namespace BBWY.Test
static void Main(string[] args)
{
var rootPath = @"C:\Users\pengcong001\Desktop";
var resultList = new List<string>();
var minDate = 11; var maxDate = 25;
rootPath = @"C:\Users\pengcong001\Desktop\test";
IJdClient client = new DefaultJdClient("https://api.jd.com/routerjson", "120EA9EC65AB017567D78CC1139EEEA5", "866a9877f5f24b03b537483b4defe75d");
for (var i = minDate; i <= maxDate; i++)
{
var content = io.File.ReadAllText(io.Path.Combine(rootPath, $"2022-05-{i}.txt"), Encoding.UTF8);
var matches = Regex.Matches(content, @"""logisticsCompanyName"":\s*""(.+)"",");
foreach (Match match in matches)
{
if (match.Success)
{
var _1688logisticsCompanyName = match.Groups[1].Value;
if (!resultList.Any(s => s.Equals(_1688logisticsCompanyName)))
resultList.Add(_1688logisticsCompanyName);
}
}
}
Console.WriteLine(resultList.Count());
var req = new AdsDspRtbKuaicheAccountCampaignReportRequest();
req.pageSize = 20;
req.clickOrOrderDay = 1;
//req.obys = "abc";
req.giftFlag = 0;
req.orderStatusCategory = 1;
req.endDay = DateTime.Now.Date.AddDays(-1);
req.isDaily = true;
req.startDay = DateTime.Now.Date;
req.page = 1;
//req.platform = "abc";
req.clickOrOrderCaliber = 0;
var response = client.Execute(req, "ebd15797ff344a8da8e74879cb2acd13mtu3", DateTime.Now.ToLocalTime());
Console.WriteLine(JsonConvert.SerializeObject(response));
foreach (var s in resultList)
Console.WriteLine(s);
Console.ReadKey();
}
}

Loading…
Cancel
Save