feat(wxapi): 新增小程序联盟定向计划推广相关接口

This commit is contained in:
fudiwei
2022-12-01 23:57:49 +08:00
parent 3116e90cea
commit 195575ad55
22 changed files with 902 additions and 20 deletions

View File

@@ -136,5 +136,153 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
return await client.SendRequestWithJsonAsync<Models.UnionShopOrderSearchNormalOrderResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
#endregion
#region Target
/// <summary>
/// <para>异步调用 [POST] /union/shop/target/add_plan 接口。</para>
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/union/custom_component/api/shop/target_plan/target_plan.html </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.UnionShopTargetAddPlanResponse> ExecuteUnionShopTargetAddPlanAsync(this WechatApiClient client, Models.UnionShopTargetAddPlanRequest 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", "shop", "target", "add_plan")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.UnionShopTargetAddPlanResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [GET] /union/shop/target/plan_list 接口。</para>
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/union/custom_component/api/shop/target_plan/target_plan.html </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.UnionShopTargetPlanListResponse> ExecuteUnionShopTargetPlanListAsync(this WechatApiClient client, Models.UnionShopTargetPlanListRequest 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", "shop", "target", "plan_list")
.SetQueryParam("access_token", request.AccessToken);
if (request.Offset != null)
flurlReq.SetQueryParam("offset", request.Offset.Value);
if (request.Limit != null)
flurlReq.SetQueryParam("limit", request.Limit.Value);
if (request.PlanStatus != null)
flurlReq.SetQueryParam("planStatus", request.PlanStatus);
if (request.PlanId != null)
flurlReq.SetQueryParam("planId", request.PlanId);
return await client.SendRequestWithJsonAsync<Models.UnionShopTargetPlanListResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [GET] /union/shop/target/product_list 接口。</para>
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/union/custom_component/api/shop/target_plan/target_plan.html </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.UnionShopTargetProductListResponse> ExecuteUnionShopTargetProductListAsync(this WechatApiClient client, Models.UnionShopTargetProductListRequest 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", "shop", "target", "product_list")
.SetQueryParam("access_token", request.AccessToken)
.SetQueryParam("planId", request.PlanId);
if (request.Offset != null)
flurlReq.SetQueryParam("offset", request.Offset.Value);
if (request.Limit != null)
flurlReq.SetQueryParam("limit", request.Limit.Value);
return await client.SendRequestWithJsonAsync<Models.UnionShopTargetProductListResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [GET] /union/shop/target/promoter_list 接口。</para>
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/union/custom_component/api/shop/target_plan/target_plan.html </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.UnionShopTargetPromoterListResponse> ExecuteUnionShopTargetPromoterListAsync(this WechatApiClient client, Models.UnionShopTargetPromoterListRequest 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", "shop", "target", "promoter_list")
.SetQueryParam("access_token", request.AccessToken)
.SetQueryParam("planId", request.PlanId);
if (request.Offset != null)
flurlReq.SetQueryParam("offset", request.Offset.Value);
if (request.Limit != null)
flurlReq.SetQueryParam("limit", request.Limit.Value);
return await client.SendRequestWithJsonAsync<Models.UnionShopTargetPromoterListResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [POST] /union/shop/target/update_plan 接口。</para>
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/union/custom_component/api/shop/target_plan/target_plan.html </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.UnionShopTargetUpdatePlanResponse> ExecuteUnionShopTargetUpdatePlanAsync(this WechatApiClient client, Models.UnionShopTargetUpdatePlanRequest 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", "shop", "target", "update_plan")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.UnionShopTargetUpdatePlanResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [POST] /union/shop/target/update_promoter 接口。</para>
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/union/custom_component/api/shop/target_plan/target_plan.html </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.UnionShopTargetUpdatePromoterResponse> ExecuteUnionShopTargetUpdatePromoterAsync(this WechatApiClient client, Models.UnionShopTargetUpdatePromoterRequest 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", "shop", "target", "update_promoter")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.UnionShopTargetUpdatePromoterResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
#endregion
}
}

View File

@@ -14,7 +14,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
/// </summary>
[Newtonsoft.Json.JsonProperty("planId")]
[System.Text.Json.Serialization.JsonPropertyName("planId")]
public string PlanId { get; set; } = default!;
/// <summary>
@@ -22,7 +21,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
/// </summary>
[Newtonsoft.Json.JsonProperty("planName")]
[System.Text.Json.Serialization.JsonPropertyName("planName")]
public string PlanName { get; set; } = default!;
/// <summary>
@@ -30,7 +28,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
/// </summary>
[Newtonsoft.Json.JsonProperty("planDesc")]
[System.Text.Json.Serialization.JsonPropertyName("planDesc")]
public string Description { get; set; } = default!;
/// <summary>
@@ -39,7 +36,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
[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; }
/// <summary>
@@ -47,7 +43,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
/// </summary>
[Newtonsoft.Json.JsonProperty("planStartTime")]
[System.Text.Json.Serialization.JsonPropertyName("planStartTime")]
public long StartTimestamp { get; set; }
/// <summary>
@@ -55,7 +50,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
/// </summary>
[Newtonsoft.Json.JsonProperty("planEndTime")]
[System.Text.Json.Serialization.JsonPropertyName("planEndTime")]
public long EndTimestamp { get; set; }
/// <summary>
@@ -64,7 +58,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
[Newtonsoft.Json.JsonProperty("extInfo")]
[System.Text.Json.Serialization.JsonPropertyName("extInfo")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.DynamicObjectConverter))]
public dynamic? Extra { get; set; }
}
@@ -98,7 +91,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
/// </summary>
[Newtonsoft.Json.JsonProperty("title")]
[System.Text.Json.Serialization.JsonPropertyName("title")]
public string Title { get; set; } = default!;
/// <summary>
@@ -106,7 +98,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
/// </summary>
[Newtonsoft.Json.JsonProperty("subTitle")]
[System.Text.Json.Serialization.JsonPropertyName("subTitle")]
public string SubTitle { get; set; } = default!;
/// <summary>
@@ -114,7 +105,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
/// </summary>
[Newtonsoft.Json.JsonProperty("headImg")]
[System.Text.Json.Serialization.JsonPropertyName("headImg")]
public string[] HeadImageUrlList { get; set; } = default!;
/// <summary>
@@ -122,7 +112,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
/// </summary>
[Newtonsoft.Json.JsonProperty("category")]
[System.Text.Json.Serialization.JsonPropertyName("category")]
public Types.Category[] CategoryList { get; set; } = default!;
/// <summary>
@@ -230,7 +219,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
/// </summary>
[Newtonsoft.Json.JsonProperty("planId")]
[System.Text.Json.Serialization.JsonPropertyName("planId")]
public string PlanId { get; set; } = default!;
/// <summary>
@@ -238,15 +226,14 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
/// </summary>
[Newtonsoft.Json.JsonProperty("productId")]
[System.Text.Json.Serialization.JsonPropertyName("productId")]
public string ProductId { get; set; } = default!;
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
public long ProductId { get; set; }
/// <summary>
/// 获取或设置商品状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("productStatus")]
[System.Text.Json.Serialization.JsonPropertyName("productStatus")]
public int ProductStatus { get; set; }
/// <summary>
@@ -261,7 +248,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
/// </summary>
[Newtonsoft.Json.JsonProperty("productDetailInfo")]
[System.Text.Json.Serialization.JsonPropertyName("productDetailInfo")]
public Types.ProductDetail ProductDetail { get; set; } = default!;
/// <summary>
@@ -269,7 +255,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
/// </summary>
[Newtonsoft.Json.JsonProperty("leagueExInfo")]
[System.Text.Json.Serialization.JsonPropertyName("leagueExInfo")]
public Types.League League { get; set; } = default!;
/// <summary>
@@ -277,7 +262,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
/// </summary>
[Newtonsoft.Json.JsonProperty("couponInfo")]
[System.Text.Json.Serialization.JsonPropertyName("couponInfo")]
public Types.Coupon Coupon { get; set; } = default!;
}
}
@@ -287,7 +271,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
/// </summary>
[Newtonsoft.Json.JsonProperty("targetPlanInfo")]
[System.Text.Json.Serialization.JsonPropertyName("targetPlanInfo")]
public Types.TargetPlan TargetPlan { get; set; } = default!;
/// <summary>
@@ -295,7 +278,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
/// </summary>
[Newtonsoft.Json.JsonProperty("productListInfo")]
[System.Text.Json.Serialization.JsonPropertyName("productListInfo")]
public Types.Product[] ProductList { get; set; } = default!;
}
}

View File

@@ -0,0 +1,75 @@
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /union/shop/target/add_plan 接口的请求。</para>
/// </summary>
public class UnionShopTargetAddPlanRequest : WechatApiRequest, IInferable<UnionShopTargetAddPlanRequest, UnionShopTargetAddPlanResponse>
{
public static class Types
{
public class Plan
{
/// <summary>
/// 获取或设置计划名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("planName")]
[System.Text.Json.Serialization.JsonPropertyName("planName")]
public string PlanName { get; set; } = string.Empty;
/// <summary>
/// 获取或设置计划描述。
/// </summary>
[Newtonsoft.Json.JsonProperty("planDesc")]
[System.Text.Json.Serialization.JsonPropertyName("planDesc")]
public string Description { get; set; } = string.Empty;
/// <summary>
/// 获取或设置计划开始时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("planStartTime")]
[System.Text.Json.Serialization.JsonPropertyName("planStartTime")]
public long StartTimestamp { get; set; }
/// <summary>
/// 获取或设置计划结束时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("planEndTime")]
[System.Text.Json.Serialization.JsonPropertyName("planEndTime")]
public long EndTimestamp { get; set; }
}
public class Product
{
/// <summary>
/// 获取或设置商品 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("productId")]
[System.Text.Json.Serialization.JsonPropertyName("productId")]
public long ProductId { get; set; }
/// <summary>
/// 获取或设置佣金率(单位:万分之一)。
/// </summary>
[Newtonsoft.Json.JsonProperty("rate")]
[System.Text.Json.Serialization.JsonPropertyName("rate")]
public int CommissionRatio { get; set; }
}
}
/// <summary>
/// 获取或设置计划信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("planItem")]
[System.Text.Json.Serialization.JsonPropertyName("planItem")]
public Types.Plan Plan { get; set; } = new Types.Plan();
/// <summary>
/// 获取或设置商品列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("productList")]
[System.Text.Json.Serialization.JsonPropertyName("productList")]
public IList<Types.Product> ProductList { get; set; } = new List<Types.Product>();
}
}

View File

@@ -0,0 +1,29 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /union/shop/target/add_plan 接口的响应。</para>
/// </summary>
public class UnionShopTargetAddPlanResponse : WechatApiResponse
{
/// <summary>
/// 获取或设置计划 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("planId")]
[System.Text.Json.Serialization.JsonPropertyName("planId")]
public string PlanId { get; set; } = default!;
/// <summary>
/// 获取或设置计划类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("planType")]
[System.Text.Json.Serialization.JsonPropertyName("planType")]
public string PlanType { get; set; } = default!;
/// <summary>
/// 获取或设置邀请链接。
/// </summary>
[Newtonsoft.Json.JsonProperty("inviteUrl")]
[System.Text.Json.Serialization.JsonPropertyName("inviteUrl")]
public string InviteUrl { get; set; } = default!;
}
}

View File

@@ -0,0 +1,36 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [GET] /union/shop/target/plan_list 接口的请求。</para>
/// </summary>
public class UnionShopTargetPlanListRequest : WechatApiRequest, IInferable<UnionShopTargetPlanListRequest, UnionShopTargetPlanListResponse>
{
/// <summary>
/// 获取或设置分页起始位置。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public int? Offset { get; set; }
/// <summary>
/// 获取或设置分页每页数量。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public int? Limit { get; set; }
/// <summary>
/// 获取或设置计划状态。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string? PlanStatus { get; set; }
/// <summary>
/// 获取或设置计划 ID。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string? PlanId { get; set; }
}
}

View File

@@ -0,0 +1,105 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [GET] /union/shop/target/plan_list 接口的响应。</para>
/// </summary>
public class UnionShopTargetPlanListResponse : WechatApiResponse
{
public static class Types
{
public class Plan
{
/// <summary>
/// 获取或设置计划 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("planId")]
[System.Text.Json.Serialization.JsonPropertyName("planId")]
public string PlanId { get; set; } = default!;
/// <summary>
/// 获取或设置计划类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("planType")]
[System.Text.Json.Serialization.JsonPropertyName("planType")]
public string PlanType { get; set; } = default!;
/// <summary>
/// 获取或设置计划名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("planName")]
[System.Text.Json.Serialization.JsonPropertyName("planName")]
public string PlanName { get; set; } = default!;
/// <summary>
/// 获取或设置计划描述。
/// </summary>
[Newtonsoft.Json.JsonProperty("planDesc")]
[System.Text.Json.Serialization.JsonPropertyName("planDesc")]
public string Description { get; set; } = default!;
/// <summary>
/// 获取或设置计划状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("planStatus")]
[System.Text.Json.Serialization.JsonPropertyName("planStatus")]
public string Status { get; set; } = default!;
/// <summary>
/// 获取或设置计划开始时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("planStartTime")]
[System.Text.Json.Serialization.JsonPropertyName("planStartTime")]
public long StartTimestamp { get; set; }
/// <summary>
/// 获取或设置计划结束时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("planEndTime")]
[System.Text.Json.Serialization.JsonPropertyName("planEndTime")]
public long EndTimestamp { get; set; }
/// <summary>
/// 获取或设置过审推客数。
/// </summary>
[Newtonsoft.Json.JsonProperty("acceptPromoterCnt")]
[System.Text.Json.Serialization.JsonPropertyName("acceptPromoterCnt")]
public int AcceptedPromoterCount { get; set; }
/// <summary>
/// 获取或设置待审批推客数。
/// </summary>
[Newtonsoft.Json.JsonProperty("auditingPromoterCnt")]
[System.Text.Json.Serialization.JsonPropertyName("auditingPromoterCnt")]
public int AuditingPromoterCnt { get; set; }
/// <summary>
/// 获取或设置邀请链接。
/// </summary>
[Newtonsoft.Json.JsonProperty("inviteUrl")]
[System.Text.Json.Serialization.JsonPropertyName("inviteUrl")]
public string InviteUrl { get; set; } = default!;
}
}
/// <summary>
/// 获取或设置计划列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("planList")]
[System.Text.Json.Serialization.JsonPropertyName("planList")]
public Types.Plan[]? PlanList { get; set; }
/// <summary>
/// 获取或设置计划信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("plan")]
[System.Text.Json.Serialization.JsonPropertyName("plan")]
public Types.Plan? Plan { get; set; }
/// <summary>
/// 获取或设置总数量。
/// </summary>
[Newtonsoft.Json.JsonProperty("total")]
[System.Text.Json.Serialization.JsonPropertyName("total")]
public int? TotalCount { get; set; }
}
}

View File

@@ -0,0 +1,29 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [GET] /union/shop/target/product_list 接口的请求。</para>
/// </summary>
public class UnionShopTargetProductListRequest : WechatApiRequest, IInferable<UnionShopTargetProductListRequest, UnionShopTargetProductListResponse>
{
/// <summary>
/// 获取或设置计划 ID。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string PlanId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置分页起始位置。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public int? Offset { get; set; }
/// <summary>
/// 获取或设置分页每页数量。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public int? Limit { get; set; }
}
}

View File

@@ -0,0 +1,114 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [GET] /union/shop/target/product_list 接口的响应。</para>
/// </summary>
public class UnionShopTargetProductListResponse : WechatApiResponse
{
public static class Types
{
public class Product
{
public static class Types
{
public class Category
{
/// <summary>
/// 获取或设置商品类目 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("catId")]
[System.Text.Json.Serialization.JsonPropertyName("catId")]
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
public int CategoryId { get; set; }
/// <summary>
/// 获取或设置商品类目层级。
/// </summary>
[Newtonsoft.Json.JsonProperty("level")]
[System.Text.Json.Serialization.JsonPropertyName("level")]
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
public int Level { get; set; }
/// <summary>
/// 获取或设置上级商品类目名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("name")]
[System.Text.Json.Serialization.JsonPropertyName("name")]
public string Name { get; set; } = default!;
}
}
/// <summary>
/// 获取或设置商品 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("productId")]
[System.Text.Json.Serialization.JsonPropertyName("productId")]
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
public long ProductId { get; set; }
/// <summary>
/// 获取或设置商品 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("outProductId")]
[System.Text.Json.Serialization.JsonPropertyName("outProductId")]
public string OutProductId { get; set; } = default!;
/// <summary>
/// 获取或设置商品标题。
/// </summary>
[Newtonsoft.Json.JsonProperty("title")]
[System.Text.Json.Serialization.JsonPropertyName("title")]
public string Title { get; set; } = default!;
/// <summary>
/// 获取或设置商品主图 URL。
/// </summary>
[Newtonsoft.Json.JsonProperty("headImg")]
[System.Text.Json.Serialization.JsonPropertyName("headImg")]
public string HeadImageUrl { get; set; } = default!;
/// <summary>
/// 获取或设置商品类目列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("cats")]
[System.Text.Json.Serialization.JsonPropertyName("cats")]
public Types.Category[] CategoryList { get; set; } = default!;
/// <summary>
/// 获取或设置小程序页面路径。
/// </summary>
[Newtonsoft.Json.JsonProperty("path")]
[System.Text.Json.Serialization.JsonPropertyName("path")]
public string MiniProgramPagePath { get; set; } = default!;
/// <summary>
/// 获取或设置最低价格(单位:分)。
/// </summary>
[Newtonsoft.Json.JsonProperty("minPrice")]
[System.Text.Json.Serialization.JsonPropertyName("minPrice")]
public int MinPrice { get; set; }
/// <summary>
/// 获取或设置商品库存。
/// </summary>
[Newtonsoft.Json.JsonProperty("totalStockNum")]
[System.Text.Json.Serialization.JsonPropertyName("totalStockNum")]
public int Stock { get; set; }
/// <summary>
/// 获取或设置佣金率(单位:万分之一)。
/// </summary>
[Newtonsoft.Json.JsonProperty("commissionRatio")]
[System.Text.Json.Serialization.JsonPropertyName("commissionRatio")]
public int CommissionRatio { get; set; }
}
}
/// <summary>
/// 获取或设置商品列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("productList")]
[System.Text.Json.Serialization.JsonPropertyName("productList")]
public Types.Product[] ProductList { get; set; } = default!;
}
}

View File

@@ -0,0 +1,29 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [GET] /union/shop/target/promoter_list 接口的请求。</para>
/// </summary>
public class UnionShopTargetPromoterListRequest : WechatApiRequest, IInferable<UnionShopTargetPromoterListRequest, UnionShopTargetPromoterListResponse>
{
/// <summary>
/// 获取或设置计划 ID。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string PlanId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置分页起始位置。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public int? Offset { get; set; }
/// <summary>
/// 获取或设置分页每页数量。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public int? Limit { get; set; }
}
}

View File

@@ -0,0 +1,70 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [GET] /union/shop/target/promoter_list 接口的响应。</para>
/// </summary>
public class UnionShopTargetPromoterListResponse : WechatApiResponse
{
public static class Types
{
public class Promoter
{
/// <summary>
/// 获取或设置微信 AppId。
/// </summary>
[Newtonsoft.Json.JsonProperty("appid")]
[System.Text.Json.Serialization.JsonPropertyName("appid")]
public string AppId { get; set; } = default!;
/// <summary>
/// 获取或设置昵称。
/// </summary>
[Newtonsoft.Json.JsonProperty("nickname")]
[System.Text.Json.Serialization.JsonPropertyName("nickname")]
public string Nickname { get; set; } = default!;
/// <summary>
/// 获取或设置账号类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("promoterType")]
[System.Text.Json.Serialization.JsonPropertyName("promoterType")]
public string PromoterType { get; set; } = default!;
/// <summary>
/// 获取或设置申请时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("applyTime")]
[System.Text.Json.Serialization.JsonPropertyName("applyTime")]
public long ApplyTimestamp { get; set; }
/// <summary>
/// 获取或设置过审状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("promoterStatus")]
[System.Text.Json.Serialization.JsonPropertyName("promoterStatus")]
public string Status { get; set; } = default!;
/// <summary>
/// 获取或设置通过时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("joinTime")]
[System.Text.Json.Serialization.JsonPropertyName("joinTime")]
public long? Joinimestamp { get; set; }
/// <summary>
/// 获取或设置申请理由。
/// </summary>
[Newtonsoft.Json.JsonProperty("applyReason")]
[System.Text.Json.Serialization.JsonPropertyName("applyReason")]
public string? ApplyReason { get; set; }
}
}
/// <summary>
/// 获取或设置推客列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("promoterList")]
[System.Text.Json.Serialization.JsonPropertyName("promoterList")]
public Types.Promoter[] PromoterList { get; set; } = default!;
}
}

View File

@@ -0,0 +1,76 @@
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /union/shop/target/update_plan 接口的请求。</para>
/// </summary>
public class UnionShopTargetUpdatePlanRequest : WechatApiRequest, IInferable<UnionShopTargetUpdatePlanRequest, UnionShopTargetUpdatePlanResponse>
{
public static class Types
{
public class Plan
{
/// <summary>
/// 获取或设置计划名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("planName")]
[System.Text.Json.Serialization.JsonPropertyName("planName")]
public string? PlanName { get; set; }
/// <summary>
/// 获取或设置计划描述。
/// </summary>
[Newtonsoft.Json.JsonProperty("planDesc")]
[System.Text.Json.Serialization.JsonPropertyName("planDesc")]
public string? Description { get; set; }
/// <summary>
/// 获取或设置计划开始时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("planStartTime")]
[System.Text.Json.Serialization.JsonPropertyName("planStartTime")]
public long? StartTimestamp { get; set; }
/// <summary>
/// 获取或设置计划结束时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("planEndTime")]
[System.Text.Json.Serialization.JsonPropertyName("planEndTime")]
public long? EndTimestamp { get; set; }
/// <summary>
/// 获取或设置计划状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("planStatus")]
[System.Text.Json.Serialization.JsonPropertyName("planStatus")]
public string? Status { get; set; }
}
public class Product : UnionShopTargetAddPlanRequest.Types.Product
{
}
}
/// <summary>
/// 获取或设置计划 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("planId")]
[System.Text.Json.Serialization.JsonPropertyName("planId")]
public string PlanId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置计划信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("planItem")]
[System.Text.Json.Serialization.JsonPropertyName("planItem")]
public Types.Plan? Plan { get; set; }
/// <summary>
/// 获取或设置商品列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("productList")]
[System.Text.Json.Serialization.JsonPropertyName("productList")]
public IList<Types.Product>? ProductList { get; set; }
}
}

View File

@@ -0,0 +1,22 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /union/shop/target/update_plan 接口的响应。</para>
/// </summary>
public class UnionShopTargetUpdatePlanResponse : WechatApiResponse
{
/// <summary>
/// 获取或设置计划 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("planId")]
[System.Text.Json.Serialization.JsonPropertyName("planId")]
public string PlanId { get; set; } = default!;
/// <summary>
/// 获取或设置邀请链接。
/// </summary>
[Newtonsoft.Json.JsonProperty("inviteUrl")]
[System.Text.Json.Serialization.JsonPropertyName("inviteUrl")]
public string InviteUrl { get; set; } = default!;
}
}

View File

@@ -0,0 +1,31 @@
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /union/shop/target/update_promoter 接口的请求。</para>
/// </summary>
public class UnionShopTargetUpdatePromoterRequest : WechatApiRequest, IInferable<UnionShopTargetUpdatePromoterRequest, UnionShopTargetUpdatePromoterResponse>
{
/// <summary>
/// 获取或设置计划 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("planId")]
[System.Text.Json.Serialization.JsonPropertyName("planId")]
public string PlanId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置 AppId 列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("appidList")]
[System.Text.Json.Serialization.JsonPropertyName("appidList")]
public IList<string> AppIdList { get; set; } = new List<string>();
/// <summary>
/// 获取或设置推客状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("promoterStatus")]
[System.Text.Json.Serialization.JsonPropertyName("promoterStatus")]
public string PromoterStatus { get; set; } = string.Empty;
}
}

View File

@@ -0,0 +1,9 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /union/shop/target/update_promoter 接口的响应。</para>
/// </summary>
public class UnionShopTargetUpdatePromoterResponse : WechatApiResponse
{
}
}