diff --git a/BBWY.JDSDK/Request/AdsDspRtbKuaicheAccountCampaignReportRequest.cs b/BBWY.JDSDK/Request/AdsDspRtbKuaicheAccountCampaignReportRequest.cs new file mode 100644 index 00000000..e23bbd55 --- /dev/null +++ b/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 + { + public int pageSize { get; set; } + + public int page { get; set; } + + /// + /// 当天:0;昨天:1;最近15天:15 + /// + public int clickOrOrderDay { get; set; } + + /// + /// 赠品筛选 0 非赠品 1 赠品 + /// + public int giftFlag { get; set; } + + /// + /// 空:全部订单 1:成交订单 + /// + public Nullable orderStatusCategory { get; set; } + + public DateTime endDay { get; set; } + + public DateTime startDay { get; set; } + + /// + /// 是否分日 true: 分日 false:不分日 + /// + public bool isDaily { get; set; } + + public string platform { get; set; } + + /// + /// 点击口径:0 订单口径:1 + /// + public int clickOrOrderCaliber { get; set; } + + public override string ApiName => "jingdong.ads.dsp.rtb.kuaiche.accountCampaignReport"; + + protected override void PrepareParam(IDictionary 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); + } + } +} diff --git a/BBWY.JDSDK/Request/SkuReadSearchSkuListRequest.cs b/BBWY.JDSDK/Request/SkuReadSearchSkuListRequest.cs index d05dc39f..6d298b0f 100644 --- a/BBWY.JDSDK/Request/SkuReadSearchSkuListRequest.cs +++ b/BBWY.JDSDK/Request/SkuReadSearchSkuListRequest.cs @@ -6,109 +6,115 @@ namespace Jd.Api.Request { public class SkuReadSearchSkuListRequest : JdRequestBase { - public string - wareId {get; set; } - public string - skuId {get; set; } - public string - skuStatuValue {get; set; } - public Nullable - maxStockNum - {get; set;} - - public Nullable - minStockNum - {get; set;} - - public Nullable - endCreatedTime - {get; set;} - - public Nullable - endModifiedTime - {get; set;} - - public Nullable - startCreatedTime - {get; set;} - - public Nullable - startModifiedTime - {get; set;} - - public string - outId {get; set; } - public Nullable - colType - {get; set;} - - public string - itemNum - {get; set;} - - public string - wareTitle - {get; set;} - - public string - orderFiled {get; set; } - public string - orderType {get; set; } - public Nullable - pageNo - {get; set;} - - public Nullable - pageSize - {get; set;} - - public string - field - {get; set;} - - public override string ApiName - { - get{return "jingdong.sku.read.searchSkuList";} - } - protected override void PrepareParam(IDictionary parameters) - { - parameters.Add("wareId", this. wareId -); - parameters.Add("skuId", this. skuId -); - parameters.Add("skuStatuValue", this. skuStatuValue -); - parameters.Add("maxStockNum", this. maxStockNum -); - parameters.Add("minStockNum", this. minStockNum -); - parameters.Add("endCreatedTime", this. endCreatedTime -); - parameters.Add("endModifiedTime", this. endModifiedTime -); - parameters.Add("startCreatedTime", this. startCreatedTime -); - parameters.Add("startModifiedTime", this. startModifiedTime -); - parameters.Add("outId", this. outId -); - parameters.Add("colType", this. colType -); - parameters.Add("itemNum", this. itemNum -); - parameters.Add("wareTitle", this. wareTitle -); - parameters.Add("orderFiled", this. orderFiled -); - parameters.Add("orderType", this. orderType -); - parameters.Add("pageNo", this. pageNo -); - parameters.Add("page_size", this. pageSize -); - parameters.Add("field", this. field -); - } + public string +wareId + { get; set; } + public string +skuId + { get; set; } + public string +skuStatuValue + { get; set; } + public Nullable +maxStockNum + { get; set; } + + public Nullable +minStockNum + { get; set; } + + public Nullable +endCreatedTime + { get; set; } + + public Nullable +endModifiedTime + { get; set; } + + public Nullable +startCreatedTime + { get; set; } + + public Nullable +startModifiedTime + { get; set; } + + public string +outId + { get; set; } + public Nullable +colType + { get; set; } + + public string +itemNum + { get; set; } + + public string +wareTitle + { get; set; } + + public string +orderFiled + { get; set; } + public string +orderType + { get; set; } + public Nullable +pageNo + { get; set; } + + public Nullable + pageSize + { get; set; } + + public string +field + { get; set; } + + public override string ApiName + { + get { return "jingdong.sku.read.searchSkuList"; } + } + protected override void PrepareParam(IDictionary parameters) + { + parameters.Add("wareId", this.wareId +); + parameters.Add("skuId", this.skuId +); + parameters.Add("skuStatuValue", this.skuStatuValue +); + parameters.Add("maxStockNum", this.maxStockNum +); + parameters.Add("minStockNum", this.minStockNum +); + parameters.Add("endCreatedTime", this.endCreatedTime +); + parameters.Add("endModifiedTime", this.endModifiedTime +); + parameters.Add("startCreatedTime", this.startCreatedTime +); + parameters.Add("startModifiedTime", this.startModifiedTime +); + parameters.Add("outId", this.outId +); + parameters.Add("colType", this.colType +); + parameters.Add("itemNum", this.itemNum +); + parameters.Add("wareTitle", this.wareTitle +); + parameters.Add("orderFiled", this.orderFiled +); + parameters.Add("orderType", this.orderType +); + parameters.Add("pageNo", this.pageNo +); + parameters.Add("page_size", this.pageSize +); + parameters.Add("field", this.field +); + } } } @@ -116,6 +122,6 @@ namespace Jd.Api.Request - - + + diff --git a/BBWY.JDSDK/Response/ActyEnqueryRegistrationDataCountResponse.cs b/BBWY.JDSDK/Response/ActyEnqueryRegistrationDataCountResponse.cs index 0bd54cfe..077aed23 100644 --- a/BBWY.JDSDK/Response/ActyEnqueryRegistrationDataCountResponse.cs +++ b/BBWY.JDSDK/Response/ActyEnqueryRegistrationDataCountResponse.cs @@ -2,15 +2,16 @@ using System; using System.Xml.Serialization; using System.Collections.Generic; using Newtonsoft.Json; - using Jd.Api.Domain; - namespace Jd.Api.Response +using Jd.Api.Domain; +namespace Jd.Api.Response { -public class ActyEnqueryRegistrationDataCountResponse:JdResponse{ - [JsonProperty("queryregistrationdatacount_result")] -public ActyResult + public class ActyEnqueryRegistrationDataCountResponse : JdResponse + { + [JsonProperty("queryregistrationdatacount_result")] + public ActyResult - queryregistrationdatacountResult - { get; set; } - } + queryregistrationdatacountResult + { get; set; } + } } diff --git a/BBWY.JDSDK/Response/AdsDspRtbKuaicheAccountCampaignReportResponse.cs b/BBWY.JDSDK/Response/AdsDspRtbKuaicheAccountCampaignReportResponse.cs new file mode 100644 index 00000000..4819012f --- /dev/null +++ b/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; } + } +} diff --git a/BBWY.JDSDK/Response/AfsserviceAlltaskGetResponse.cs b/BBWY.JDSDK/Response/AfsserviceAlltaskGetResponse.cs index b41c83a0..f8f16f47 100644 --- a/BBWY.JDSDK/Response/AfsserviceAlltaskGetResponse.cs +++ b/BBWY.JDSDK/Response/AfsserviceAlltaskGetResponse.cs @@ -2,15 +2,16 @@ using System; using System.Xml.Serialization; using System.Collections.Generic; using Newtonsoft.Json; - using Jd.Api.Domain; - namespace Jd.Api.Response +using Jd.Api.Domain; +namespace Jd.Api.Response { -public class AfsserviceAlltaskGetResponse:JdResponse{ - [JsonProperty("publicResultObject5")] -public PublicResultObject5 + public class AfsserviceAlltaskGetResponse : JdResponse + { + [JsonProperty("publicResultObject5")] + public PublicResultObject5 - publicResultObject5 - { get; set; } - } + publicResultObject5 + { get; set; } + } } diff --git a/BBWY.Test/BBWY.Test.csproj b/BBWY.Test/BBWY.Test.csproj index 58bb9eb0..a2a4b011 100644 --- a/BBWY.Test/BBWY.Test.csproj +++ b/BBWY.Test/BBWY.Test.csproj @@ -9,4 +9,8 @@ + + + + diff --git a/BBWY.Test/Program.cs b/BBWY.Test/Program.cs index 631ac2e5..3fde252d 100644 --- a/BBWY.Test/Program.cs +++ b/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(); - 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(); } }