From 2d53008dc338d4fd829b7f776918a7c64bd567c3 Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Mon, 18 Oct 2021 15:57:11 +0800 Subject: [PATCH] =?UTF-8?q?feat(wxapi):=20=E6=96=B0=E5=A2=9E=E5=B0=8F?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E8=81=94=E7=9B=9F=E5=AE=9A=E5=90=91=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E6=8E=A8=E5=B9=BF=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ApiClientExecuteUnionPromoterExtensions.cs | 64 ++++ .../UnionPromoterProductListResponse.cs | 16 +- .../UnionPromoterTargetApplyStatusRequest.cs | 18 ++ .../UnionPromoterTargetApplyStatusResponse.cs | 73 +++++ .../UnionPromoterTargetApplyTargetRequest.cs | 25 ++ .../UnionPromoterTargetApplyTargetResponse.cs | 12 + .../UnionPromoterTargetPlanInfoRequest.cs | 18 ++ .../UnionPromoterTargetPlanInfoResponse.cs | 304 ++++++++++++++++++ ...UnionPromoterTargetApplyStatusRequest.json | 1 + ...nionPromoterTargetApplyStatusResponse.json | 13 + ...UnionPromoterTargetApplyTargetRequest.json | 4 + ...nionPromoterTargetApplyTargetResponse.json | 4 + .../UnionPromoterTargetPlanInfoRequest.json | 1 + .../UnionPromoterTargetPlanInfoResponse.json | 69 ++++ 14 files changed, 614 insertions(+), 8 deletions(-) create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/UnionPromoter/Target/UnionPromoterTargetApplyStatusRequest.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/UnionPromoter/Target/UnionPromoterTargetApplyStatusResponse.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/UnionPromoter/Target/UnionPromoterTargetApplyTargetRequest.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/UnionPromoter/Target/UnionPromoterTargetApplyTargetResponse.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/UnionPromoter/Target/UnionPromoterTargetPlanInfoRequest.cs create mode 100644 src/SKIT.FlurlHttpClient.Wechat.Api/Models/UnionPromoter/Target/UnionPromoterTargetPlanInfoResponse.cs create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/UnionPromoter/Target/UnionPromoterTargetApplyStatusRequest.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/UnionPromoter/Target/UnionPromoterTargetApplyStatusResponse.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/UnionPromoter/Target/UnionPromoterTargetApplyTargetRequest.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/UnionPromoter/Target/UnionPromoterTargetApplyTargetResponse.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/UnionPromoter/Target/UnionPromoterTargetPlanInfoRequest.json create mode 100644 test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/UnionPromoter/Target/UnionPromoterTargetPlanInfoResponse.json diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteUnionPromoterExtensions.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteUnionPromoterExtensions.cs index 87bed57d..e857ef91 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteUnionPromoterExtensions.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteUnionPromoterExtensions.cs @@ -250,5 +250,69 @@ namespace SKIT.FlurlHttpClient.Wechat.Api return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); } #endregion + + #region Target + /// + /// 异步调用 [GET] /union/promoter/target/plan_info 接口。 + /// REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/union/access-guidelines/promoter/api/target_plan/target_plan.html + /// + /// + /// + /// + /// + public static async Task ExecuteUnionPromoterTargetPlanInfoAsync(this WechatApiClient client, Models.UnionPromoterTargetPlanInfoRequest request, CancellationToken cancellationToken = default) + { + if (client is null) throw new ArgumentNullException(nameof(client)); + if (request is null) throw new ArgumentNullException(nameof(request)); + + IFlurlRequest flurlReq = client + .CreateRequest(request, HttpMethod.Get, "union", "promoter", "target", "plan_info") + .SetQueryParam("access_token", request.AccessToken) + .SetQueryParam("planInvitationUrl", request.PlanInvitaionUrl); + + return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + } + + /// + /// 异步调用 [POST] /union/promoter/target/apply_target 接口。 + /// REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/union/access-guidelines/promoter/api/target_plan/target_plan.html + /// + /// + /// + /// + /// + public static async Task ExecuteUnionPromoterTargetApplyTargetAsync(this WechatApiClient client, Models.UnionPromoterTargetApplyTargetRequest request, CancellationToken cancellationToken = default) + { + if (client is null) throw new ArgumentNullException(nameof(client)); + if (request is null) throw new ArgumentNullException(nameof(request)); + + IFlurlRequest flurlReq = client + .CreateRequest(request, HttpMethod.Post, "union", "promoter", "target", "apply_target") + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + } + + /// + /// 异步调用 [GET] /union/promoter/target/apply_status 接口。 + /// REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/union/access-guidelines/promoter/api/target_plan/target_plan.html + /// + /// + /// + /// + /// + public static async Task ExecuteUnionPromoterTargetApplyStatusAsync(this WechatApiClient client, Models.UnionPromoterTargetApplyStatusRequest request, CancellationToken cancellationToken = default) + { + if (client is null) throw new ArgumentNullException(nameof(client)); + if (request is null) throw new ArgumentNullException(nameof(request)); + + IFlurlRequest flurlReq = client + .CreateRequest(request, HttpMethod.Get, "union", "promoter", "target", "apply_status") + .SetQueryParam("access_token", request.AccessToken) + .SetQueryParam("planId", request.PlanId); + + return await client.SendRequestWithJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken); + } + #endregion } } diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/UnionPromoter/Product/UnionPromoterProductListResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/UnionPromoter/Product/UnionPromoterProductListResponse.cs index 5b4378ad..0cc292ea 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/UnionPromoter/Product/UnionPromoterProductListResponse.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/UnionPromoter/Product/UnionPromoterProductListResponse.cs @@ -36,7 +36,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models public string Name { get; set; } = default!; } - public class Attribute + public class Parameter { /// /// 获取或设置属性的 Key。 @@ -93,7 +93,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models public string? SubTitle { get; set; } /// - /// 获取或设置主图 Url 列表。 + /// 获取或设置商品主图 URL 列表。 /// [Newtonsoft.Json.JsonProperty("headImg")] [System.Text.Json.Serialization.JsonPropertyName("headImg")] @@ -140,7 +140,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models /// [Newtonsoft.Json.JsonProperty("param")] [System.Text.Json.Serialization.JsonPropertyName("param")] - public Attribute[] AttributeList { get; set; } = default!; + public Parameter[] ParameterList { get; set; } = default!; /// /// 获取或设置运费信息。 @@ -161,7 +161,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models /// [Newtonsoft.Json.JsonProperty("totalStockNum")] [System.Text.Json.Serialization.JsonPropertyName("totalStockNum")] - public int Stock { get; set; } + public int TotalStock { get; set; } } public class SKU @@ -233,7 +233,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models /// [Newtonsoft.Json.JsonProperty("status")] [System.Text.Json.Serialization.JsonPropertyName("status")] - public int Status { get; set; } + public int? Status { get; set; } /// /// 获取或设置 SKU 基本信息。 @@ -491,7 +491,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.NumericalBooleanConverter))] [System.Text.Json.Serialization.JsonPropertyName("hasCoupon")] [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalBooleanConverter))] - public bool HasCommission { get; set; } + public bool HasCoupon { get; set; } /// /// 获取或设置优惠券 ID。 @@ -504,8 +504,8 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models /// /// 获取或设置优惠券详细信息。 /// - [Newtonsoft.Json.JsonProperty("couponInfo")] - [System.Text.Json.Serialization.JsonPropertyName("couponInfo")] + [Newtonsoft.Json.JsonProperty("couponDetail")] + [System.Text.Json.Serialization.JsonPropertyName("couponDetail")] public Types.CouponDetail? CouponDetail { get; set; } } } diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/UnionPromoter/Target/UnionPromoterTargetApplyStatusRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/UnionPromoter/Target/UnionPromoterTargetApplyStatusRequest.cs new file mode 100644 index 00000000..fbb9911b --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/UnionPromoter/Target/UnionPromoterTargetApplyStatusRequest.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [GET] /union/promoter/target/apply_status 接口的请求。 + /// + public class UnionPromoterTargetApplyStatusRequest : WechatApiRequest + { + /// + /// 获取或设置定向计划 ID。 + /// + [Newtonsoft.Json.JsonProperty("planId")] + [System.Text.Json.Serialization.JsonPropertyName("planId")] + public string PlanId { get; set; } = string.Empty; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/UnionPromoter/Target/UnionPromoterTargetApplyStatusResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/UnionPromoter/Target/UnionPromoterTargetApplyStatusResponse.cs new file mode 100644 index 00000000..92fc47fe --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/UnionPromoter/Target/UnionPromoterTargetApplyStatusResponse.cs @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [GET] /union/promoter/target/apply_status 接口的响应。 + /// + public class UnionPromoterTargetApplyStatusResponse : WechatApiResponse + { + public static class Types + { + public class Data + { + /// + /// 获取或设置定向计划 ID。 + /// + [Newtonsoft.Json.JsonProperty("planId")] + [System.Text.Json.Serialization.JsonPropertyName("planId")] + public string PlanId { get; set; } = default!; + + /// + /// 获取或设置申请状态。 + /// + [Newtonsoft.Json.JsonProperty("promoterStatus")] + [System.Text.Json.Serialization.JsonPropertyName("promoterStatus")] + public int PromoterStatus { get; set; } + + /// + /// 获取或设置申请原因。 + /// + [Newtonsoft.Json.JsonProperty("applyReason")] + [System.Text.Json.Serialization.JsonPropertyName("applyReason")] + public string? ApplyReason { get; set; } + + /// + /// 获取或设置申请时间戳。 + /// + [Newtonsoft.Json.JsonProperty("applyTime")] + [System.Text.Json.Serialization.JsonPropertyName("applyTime")] + public long? ApplyTimestamp { get; set; } + + /// + /// 获取或设置加入时间戳。 + /// + [Newtonsoft.Json.JsonProperty("joinTime")] + [System.Text.Json.Serialization.JsonPropertyName("joinTime")] + public long? JoinTimestamp { get; set; } + + /// + /// 获取或设置拒绝时间戳。 + /// + [Newtonsoft.Json.JsonProperty("rejectTime")] + [System.Text.Json.Serialization.JsonPropertyName("rejectTime")] + public long? RejectTimestamp { get; set; } + + /// + /// 获取或设置移除时间戳。 + /// + [Newtonsoft.Json.JsonProperty("removeTime")] + [System.Text.Json.Serialization.JsonPropertyName("removeTime")] + public long? RemoveTimestamp { get; set; } + } + } + + /// + /// 获取或设置返回数据。 + /// + [Newtonsoft.Json.JsonProperty("data")] + [System.Text.Json.Serialization.JsonPropertyName("data")] + public Types.Data Data { get; set; } = default!; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/UnionPromoter/Target/UnionPromoterTargetApplyTargetRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/UnionPromoter/Target/UnionPromoterTargetApplyTargetRequest.cs new file mode 100644 index 00000000..c0332287 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/UnionPromoter/Target/UnionPromoterTargetApplyTargetRequest.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /union/promoter/target/apply_target 接口的请求。 + /// + public class UnionPromoterTargetApplyTargetRequest : WechatApiRequest + { + /// + /// 获取或设置定向计划 ID。 + /// + [Newtonsoft.Json.JsonProperty("planId")] + [System.Text.Json.Serialization.JsonPropertyName("planId")] + public string PlanId { get; set; } = string.Empty; + + /// + /// 获取或设置申请原因。 + /// + [Newtonsoft.Json.JsonProperty("applyReason")] + [System.Text.Json.Serialization.JsonPropertyName("applyReason")] + public string ApplyReason { get; set; } = string.Empty; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/UnionPromoter/Target/UnionPromoterTargetApplyTargetResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/UnionPromoter/Target/UnionPromoterTargetApplyTargetResponse.cs new file mode 100644 index 00000000..9bf6c2fd --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/UnionPromoter/Target/UnionPromoterTargetApplyTargetResponse.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /union/promoter/target/apply_target 接口的响应。 + /// + public class UnionPromoterTargetApplyTargetResponse : WechatApiResponse + { + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/UnionPromoter/Target/UnionPromoterTargetPlanInfoRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/UnionPromoter/Target/UnionPromoterTargetPlanInfoRequest.cs new file mode 100644 index 00000000..65494fad --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/UnionPromoter/Target/UnionPromoterTargetPlanInfoRequest.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [GET] /union/promoter/target/plan_info 接口的请求。 + /// + public class UnionPromoterTargetPlanInfoRequest : WechatApiRequest + { + /// + /// 获取或设置定向计划邀请链接。 + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public string PlanInvitaionUrl { get; set; } = string.Empty; + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/UnionPromoter/Target/UnionPromoterTargetPlanInfoResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/UnionPromoter/Target/UnionPromoterTargetPlanInfoResponse.cs new file mode 100644 index 00000000..fad7f4cb --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/UnionPromoter/Target/UnionPromoterTargetPlanInfoResponse.cs @@ -0,0 +1,304 @@ +using System; +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [GET] /union/promoter/target/plan_info 接口的响应。 + /// + public class UnionPromoterTargetPlanInfoResponse : WechatApiResponse + { + public static class Types + { + public class TargetPlan + { + /// + /// 获取或设置计划 ID。 + /// + [Newtonsoft.Json.JsonProperty("planId")] + [System.Text.Json.Serialization.JsonPropertyName("planId")] + + public string PlanId { get; set; } = default!; + + /// + /// 获取或设置计划名称。 + /// + [Newtonsoft.Json.JsonProperty("planName")] + [System.Text.Json.Serialization.JsonPropertyName("planName")] + + public string PlanName { get; set; } = default!; + + /// + /// 获取或设置计划描述。 + /// + [Newtonsoft.Json.JsonProperty("planDesc")] + [System.Text.Json.Serialization.JsonPropertyName("planDesc")] + + public string Description { get; set; } = default!; + + /// + /// 获取或设置计划状态。 + /// + [Newtonsoft.Json.JsonProperty("planStatus")] + [System.Text.Json.Serialization.JsonPropertyName("planStatus")] + [System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)] + + public int Status { get; set; } + + /// + /// 获取或设置计划开始时间戳。 + /// + [Newtonsoft.Json.JsonProperty("planStartTime")] + [System.Text.Json.Serialization.JsonPropertyName("planStartTime")] + + public long StartTimestamp { get; set; } + + /// + /// 获取或设置计划结束时间戳。 + /// + [Newtonsoft.Json.JsonProperty("planEndTime")] + [System.Text.Json.Serialization.JsonPropertyName("planEndTime")] + + public long EndTimestamp { get; set; } + + /// + /// 获取或设置扩展信息。 + /// + [Newtonsoft.Json.JsonProperty("extInfo")] + [System.Text.Json.Serialization.JsonPropertyName("extInfo")] + + public object Extra { get; set; } = default!; + } + + public class Product + { + public static class Types + { + public class ProductDetail + { + public static class Types + { + public class Category : UnionPromoterProductListResponse.Types.Product.Types.ProductDetail.Types.Category + { + } + + public class Detail : UnionPromoterProductListResponse.Types.Product.Types.ProductDetail.Types.Information.Types.Detail + { + } + + public class Parameter : UnionPromoterProductListResponse.Types.Product.Types.ProductDetail.Types.Parameter + { + } + + public class SKU : UnionPromoterProductListResponse.Types.Product.Types.ProductDetail.Types.SKU + { + } + } + + /// + /// 获取或设置商品标题。 + /// + [Newtonsoft.Json.JsonProperty("title")] + [System.Text.Json.Serialization.JsonPropertyName("title")] + + public string Title { get; set; } = default!; + + /// + /// 获取或设置商品子标题。 + /// + [Newtonsoft.Json.JsonProperty("subTitle")] + [System.Text.Json.Serialization.JsonPropertyName("subTitle")] + + public string SubTitle { get; set; } = default!; + + /// + /// 获取或设置商品主图 URL 列表。 + /// + [Newtonsoft.Json.JsonProperty("headImg")] + [System.Text.Json.Serialization.JsonPropertyName("headImg")] + + public string[] HeadImageUrlList { get; set; } = default!; + + /// + /// 获取或设置商品类目列表。 + /// + [Newtonsoft.Json.JsonProperty("category")] + [System.Text.Json.Serialization.JsonPropertyName("category")] + + public Types.Category[] CategoryList { get; set; } = default!; + + /// + /// 获取或设置品牌 ID。 + /// + [Newtonsoft.Json.JsonProperty("brandId")] + [System.Text.Json.Serialization.JsonPropertyName("brandId")] + [System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)] + public int BrandId { get; set; } + + /// + /// 获取或设置品牌名称。 + /// + [Newtonsoft.Json.JsonProperty("brand")] + [System.Text.Json.Serialization.JsonPropertyName("brand")] + public string? BrandName { get; set; } + + /// + /// 获取或设置型号。 + /// + [Newtonsoft.Json.JsonProperty("model")] + [System.Text.Json.Serialization.JsonPropertyName("model")] + public string? Model { get; set; } + + /// + /// 获取或设置商品详情信息。 + /// + [Newtonsoft.Json.JsonProperty("detail")] + [System.Text.Json.Serialization.JsonPropertyName("detail")] + public Types.Detail Detail { get; set; } = default!; + + /// + /// 获取或设置商品属性列表。 + /// + [Newtonsoft.Json.JsonProperty("param")] + [System.Text.Json.Serialization.JsonPropertyName("param")] + public Types.Parameter[] ParameterList { get; set; } = default!; + + /// + /// 获取或设置 SKU 最低价格(单位:分)。 + /// + [Newtonsoft.Json.JsonProperty("minPrice")] + [System.Text.Json.Serialization.JsonPropertyName("minPrice")] + public int MinPrice { get; set; } + + /// + /// 获取或设置总库存。 + /// + [Newtonsoft.Json.JsonProperty("totalStockNum")] + [System.Text.Json.Serialization.JsonPropertyName("totalStockNum")] + public int TotalStock { get; set; } + + /// + /// 获取或设置总销量。 + /// + [Newtonsoft.Json.JsonProperty("totalSoldNum")] + [System.Text.Json.Serialization.JsonPropertyName("totalSoldNum")] + public int TotalSales { get; set; } + } + + public class League : UnionPromoterProductListResponse.Types.Product.Types.League + { + /// + /// 获取或设置是否为禁用的微信 UIN。 + /// + [Newtonsoft.Json.JsonProperty("banBizuin")] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.NumericalNullableBooleanConverter))] + [System.Text.Json.Serialization.JsonPropertyName("banBizuin")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalNullableBooleanConverter))] + public bool? IsBannedBusinessUIN { get; set; } + + /// + /// 获取或设置是否为禁用的类目。 + /// + [Newtonsoft.Json.JsonProperty("banCategory")] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.NumericalNullableBooleanConverter))] + [System.Text.Json.Serialization.JsonPropertyName("banCategory")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalNullableBooleanConverter))] + public bool? IsBannedCategory { get; set; } + + /// + /// 获取或设置是否为禁用的商品。 + /// + [Newtonsoft.Json.JsonProperty("banProduct")] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.NumericalNullableBooleanConverter))] + [System.Text.Json.Serialization.JsonPropertyName("banProduct")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumericalNullableBooleanConverter))] + public bool? IsBannedProduct { get; set; } + } + + public class Coupon : UnionPromoterProductListResponse.Types.Product.Types.Coupon + { + /// + /// 获取或设置优惠金额(单位:分)。 + /// + [Newtonsoft.Json.JsonProperty("discount")] + [System.Text.Json.Serialization.JsonPropertyName("discount")] + [System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)] + public int? Discount { get; set; } + } + } + + /// + /// 获取或设置计划 ID。 + /// + [Newtonsoft.Json.JsonProperty("planId")] + [System.Text.Json.Serialization.JsonPropertyName("planId")] + + public string PlanId { get; set; } = default!; + + /// + /// 获取或设置商品 ID。 + /// + [Newtonsoft.Json.JsonProperty("productId")] + [System.Text.Json.Serialization.JsonPropertyName("productId")] + + public string ProductId { get; set; } = default!; + + /// + /// 获取或设置商品状态。 + /// + [Newtonsoft.Json.JsonProperty("productStatus")] + [System.Text.Json.Serialization.JsonPropertyName("productStatus")] + + public int ProductStatus { get; set; } + + /// + /// 获取或设置佣金率(单位:万分之一)。 + /// + [Newtonsoft.Json.JsonProperty("commissionRatio")] + [System.Text.Json.Serialization.JsonPropertyName("commissionRatio")] + + public int CommissionRatio { get; set; } + + /// + /// 获取或设置商品详情信息。 + /// + [Newtonsoft.Json.JsonProperty("productDetailInfo")] + [System.Text.Json.Serialization.JsonPropertyName("productDetailInfo")] + + public Types.ProductDetail ProductDetail { get; set; } = default!; + + /// + /// 获取或设置联盟佣金信息。 + /// + [Newtonsoft.Json.JsonProperty("leagueExInfo")] + [System.Text.Json.Serialization.JsonPropertyName("leagueExInfo")] + + public Types.League League { get; set; } = default!; + + /// + /// 获取或设置优惠券信息。 + /// + [Newtonsoft.Json.JsonProperty("couponInfo")] + [System.Text.Json.Serialization.JsonPropertyName("couponInfo")] + + public Types.Coupon Coupon { get; set; } = default!; + } + } + + /// + /// 获取或设置定向计划信息。 + /// + [Newtonsoft.Json.JsonProperty("targetPlanInfo")] + [System.Text.Json.Serialization.JsonPropertyName("targetPlanInfo")] + + public Types.TargetPlan TargetPlan { get; set; } = default!; + + /// + /// 获取或设置商品列表。 + /// + [Newtonsoft.Json.JsonProperty("productListInfo")] + [System.Text.Json.Serialization.JsonPropertyName("productListInfo")] + + public Types.Product[] ProductList { get; set; } = default!; + } +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/UnionPromoter/Target/UnionPromoterTargetApplyStatusRequest.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/UnionPromoter/Target/UnionPromoterTargetApplyStatusRequest.json new file mode 100644 index 00000000..22fdca1b --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/UnionPromoter/Target/UnionPromoterTargetApplyStatusRequest.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/UnionPromoter/Target/UnionPromoterTargetApplyStatusResponse.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/UnionPromoter/Target/UnionPromoterTargetApplyStatusResponse.json new file mode 100644 index 00000000..3369a554 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/UnionPromoter/Target/UnionPromoterTargetApplyStatusResponse.json @@ -0,0 +1,13 @@ +{ + "errcode": 0, + "errmsg": "ok", + "data": { + "planId": "1964112935262240768", + "promoterStatus": 1, + "applyTime": 1626692835, + "joinTime": 0, + "applyReason": "okok", + "rejectTime": 0, + "removeTime": 0 + } +} \ No newline at end of file diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/UnionPromoter/Target/UnionPromoterTargetApplyTargetRequest.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/UnionPromoter/Target/UnionPromoterTargetApplyTargetRequest.json new file mode 100644 index 00000000..846e1559 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/UnionPromoter/Target/UnionPromoterTargetApplyTargetRequest.json @@ -0,0 +1,4 @@ +{ + "planId": "123LKAJSDLKJSADLKwqij21dsdsdsd312joewq=", + "applyReason": "推客申请加入原因" +} \ No newline at end of file diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/UnionPromoter/Target/UnionPromoterTargetApplyTargetResponse.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/UnionPromoter/Target/UnionPromoterTargetApplyTargetResponse.json new file mode 100644 index 00000000..f752befe --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/UnionPromoter/Target/UnionPromoterTargetApplyTargetResponse.json @@ -0,0 +1,4 @@ +{ + "errcode": 0, + "errmsg": "ok" +} \ No newline at end of file diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/UnionPromoter/Target/UnionPromoterTargetPlanInfoRequest.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/UnionPromoter/Target/UnionPromoterTargetPlanInfoRequest.json new file mode 100644 index 00000000..22fdca1b --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/UnionPromoter/Target/UnionPromoterTargetPlanInfoRequest.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/UnionPromoter/Target/UnionPromoterTargetPlanInfoResponse.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/UnionPromoter/Target/UnionPromoterTargetPlanInfoResponse.json new file mode 100644 index 00000000..2fac60f3 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/UnionPromoter/Target/UnionPromoterTargetPlanInfoResponse.json @@ -0,0 +1,69 @@ +{ + "errcode": 0, + "errmsg": "ok", + "targetPlanInfo": { + "planId": "1964112935262240768", + "planStatus": 1, + "planName": "TEST定向计划CR", + "planDesc": "TEST定向计划CR", + "planStartTime": 1629216000, + "planEndTime": 1630166399, + "extInfo": { + "bizBasicInfo": { + "headimgurl": "http://wx.qlogo.cn/mmhead/Q3auHgzwzM77ia7ibuPAQBJgME8gFF9APicaSpd7evrLCVb5hn2zsUBOw", + "nickname": "猪腩肉小商店", + "appid": "wxb825f130c284597f" + }, + "data": {} + } + }, + "productListInfo": [ + { + "planId": "1964112935262240768", + "productId": "37610006", + "productStatus": 1, + "commissionRatio": 700, + "productDetailInfo": { + "headImg": [ + "https://store.mp.video.tencent-cloud.com/161/20304/snscosdownload/SZ/reserved/60a77aac00065bee000000006a849d09000000a000004f50" + ], + "category": [ + { + "catId": "1208", + "name": "宠物生活" + }, + { + "catId": "1224", + "name": "猫狗出行" + }, + { + "catId": "1227", + "name": "宠物鞋服" + } + ], + "param": [], + "title": "新商品哈哈中", + "subTitle": "", + "model": "", + "detail": { + "detailImg": [] + }, + "brandId": "2100000000", + "totalStockNum": "128", + "totalSoldNum": "2" + }, + "leagueExInfo": { + "hasCommission": 1, + "commissionRatio": 700, + "commissionValue": 7, + "banBizuin": 0, + "banCategory": 0, + "banProduct": 0 + }, + "couponInfo": { + "couponId": "0", + "discount": "0" + } + } + ] +} \ No newline at end of file