feat(wxapi): 新增自定义交易组件优惠券相关接口

This commit is contained in:
Fu Diwei 2021-09-21 21:51:12 +08:00
parent b808fc63ab
commit 06dede8d1d
43 changed files with 1988 additions and 6 deletions

View File

@ -733,5 +733,207 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
return await client.SendRequestWithJsonAsync<Models.ShopAftersaleGetResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
#endregion
#region Coupon
/// <summary>
/// <para>异步调用 [POST] /shop/coupon/add 接口。</para>
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/coupon/add_coupon.html </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.ShopCouponAddResponse> ExecuteShopCouponAddAsync(this WechatApiClient client, Models.ShopCouponAddRequest 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, "shop", "coupon", "add")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.ShopCouponAddResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [POST] /shop/coupon/get 接口。</para>
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/coupon/get_coupon.html </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.ShopCouponGetResponse> ExecuteShopCouponGetAsync(this WechatApiClient client, Models.ShopCouponGetRequest 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, "shop", "coupon", "get")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.ShopCouponGetResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [POST] /shop/coupon/get_list 接口。</para>
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/coupon/get_coupon_list.html </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.ShopCouponGetListResponse> ExecuteShopCouponGetListAsync(this WechatApiClient client, Models.ShopCouponGetListRequest 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, "shop", "coupon", "get_list")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.ShopCouponGetListResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [POST] /shop/coupon/update 接口。</para>
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/coupon/update_coupon.html </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.ShopCouponUpdateResponse> ExecuteShopCouponUpdateAsync(this WechatApiClient client, Models.ShopCouponUpdateRequest 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, "shop", "coupon", "update")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.ShopCouponUpdateResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [POST] /shop/coupon/update_status 接口。</para>
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/coupon/update_coupon_status.html </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.ShopCouponUpdateStatusResponse> ExecuteShopCouponUpdateStatusAsync(this WechatApiClient client, Models.ShopCouponUpdateStatusRequest 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, "shop", "coupon", "update_status")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.ShopCouponUpdateStatusResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [POST] /shop/coupon/update_coupon_stock 接口。</para>
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/coupon/update_coupon_stock.html </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.ShopCouponUpdateCouponStockResponse> ExecuteShopCouponUpdateCouponStockAsync(this WechatApiClient client, Models.ShopCouponUpdateCouponStockRequest 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, "shop", "coupon", "update_coupon_stock")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.ShopCouponUpdateCouponStockResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [POST] /shop/coupon/add_user_coupon 接口。</para>
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/coupon/add_usercoupon.html </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.ShopCouponAddUserCouponResponse> ExecuteShopCouponAddUserCouponAsync(this WechatApiClient client, Models.ShopCouponAddUserCouponRequest 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, "shop", "coupon", "add_user_coupon")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.ShopCouponAddUserCouponResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [POST] /shop/coupon/get_usercoupon_list 接口。</para>
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/coupon/get_usercoupon_list.html </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.ShopCouponGetUserCouponListResponse> ExecuteShopCouponGetUserCouponListAsync(this WechatApiClient client, Models.ShopCouponGetUserCouponListRequest 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, "shop", "coupon", "get_usercoupon_list")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.ShopCouponGetUserCouponListResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [POST] /shop/coupon/update_user_coupon 接口。</para>
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/coupon/update_usercoupon.html </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.ShopCouponUpdateUserCouponResponse> ExecuteShopCouponUpdateUserCouponAsync(this WechatApiClient client, Models.ShopCouponUpdateUserCouponRequest 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, "shop", "coupon", "update_user_coupon")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.ShopCouponUpdateUserCouponResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [POST] /shop/coupon/update_usercoupon_status 接口。</para>
/// <para>REF: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent2/API/coupon/update_usercoupon_status.html </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.ShopCouponUpdateUserCouponStatusResponse> ExecuteShopCouponUpdateUserCouponStatusAsync(this WechatApiClient client, Models.ShopCouponUpdateUserCouponStatusRequest 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, "shop", "coupon", "update_usercoupon_status")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.ShopCouponUpdateUserCouponStatusResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
#endregion
}
}

View File

@ -116,28 +116,28 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
/// </summary>
[Newtonsoft.Json.JsonProperty("limit_num_one_person")]
[System.Text.Json.Serialization.JsonPropertyName("limit_num_one_person")]
public int LimitPerUser { get; set; }
public int? LimitPerUser { get; set; }
/// <summary>
/// 获取或设置领取总数量。
/// </summary>
[Newtonsoft.Json.JsonProperty("total_num")]
[System.Text.Json.Serialization.JsonPropertyName("total_num")]
public int TotalNumber { get; set; }
public int? TotalNumber { get; set; }
/// <summary>
/// 获取或设置领取开始时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("start_time")]
[System.Text.Json.Serialization.JsonPropertyName("start_time")]
public long StartTimestamp { get; set; }
public long? StartTimestamp { get; set; }
/// <summary>
/// 获取或设置领取结束时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("end_time")]
[System.Text.Json.Serialization.JsonPropertyName("end_time")]
public long EndTimestamp { get; set; }
public long? EndTimestamp { get; set; }
}
public class Validity

View File

@ -127,14 +127,14 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
/// </summary>
[Newtonsoft.Json.JsonProperty("limit_num_one_person")]
[System.Text.Json.Serialization.JsonPropertyName("limit_num_one_person")]
public int LimitPerUser { get; set; }
public int? LimitPerUser { get; set; }
/// <summary>
/// 获取或设置领取总数量。
/// </summary>
[Newtonsoft.Json.JsonProperty("total_num")]
[System.Text.Json.Serialization.JsonPropertyName("total_num")]
public int TotalNumber { get; set; }
public int? TotalNumber { get; set; }
/// <summary>
/// 获取或设置领取开始时间戳。

View File

@ -0,0 +1,250 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /shop/coupon/add 接口的请求。</para>
/// </summary>
public class ShopCouponAddRequest : WechatApiRequest
{
public static class Types
{
public class Coupon
{
public static class Types
{
public class CouponDetail
{
public static class Types
{
public class Discount
{
public static class Types
{
public class DiscountCondidtion
{
public static class Types
{
public class TradeIn
{
/// <summary>
/// 获取或设置商家自定义商品 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("out_product_id")]
[System.Text.Json.Serialization.JsonPropertyName("out_product_id")]
public string OutProductId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置换购金额(单位:分)。
/// </summary>
[Newtonsoft.Json.JsonProperty("price")]
[System.Text.Json.Serialization.JsonPropertyName("price")]
public int Price { get; set; }
}
public class BuyGet
{
/// <summary>
/// 获取或设置购买的商家自定义商品 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("buy_out_product_id")]
[System.Text.Json.Serialization.JsonPropertyName("buy_out_product_id")]
public string BuyOutProductId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置购买的商品数量。
/// </summary>
[Newtonsoft.Json.JsonProperty("buy_product_cnt")]
[System.Text.Json.Serialization.JsonPropertyName("buy_product_cnt")]
public int BuyProductCount { get; set; }
/// <summary>
/// 获取或设置赠送的商家自定义商品 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("get_out_product_id")]
[System.Text.Json.Serialization.JsonPropertyName("get_out_product_id")]
public string GetOutProductId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置赠送的商品数量。
/// </summary>
[Newtonsoft.Json.JsonProperty("get_product_cnt")]
[System.Text.Json.Serialization.JsonPropertyName("get_product_cnt")]
public int GetProductCount { get; set; }
}
}
/// <summary>
/// 获取或设置商品数量。
/// </summary>
[Newtonsoft.Json.JsonProperty("product_cnt")]
[System.Text.Json.Serialization.JsonPropertyName("product_cnt")]
public int? ProductCount { get; set; }
/// <summary>
/// 获取或设置商品价格(单位:分)。
/// </summary>
[Newtonsoft.Json.JsonProperty("product_price")]
[System.Text.Json.Serialization.JsonPropertyName("product_price")]
public int? ProductPrice { get; set; }
/// <summary>
/// 获取或设置商家自定义商品 ID 列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("out_product_ids")]
[System.Text.Json.Serialization.JsonPropertyName("out_product_ids")]
public IList<string>? ProductIdList { get; set; }
/// <summary>
/// 获取或设置换购信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("tradein_info")]
[System.Text.Json.Serialization.JsonPropertyName("tradein_info")]
public Types.TradeIn? TradeIn { get; set; }
/// <summary>
/// 获取或设置买赠券信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("buyget_info")]
[System.Text.Json.Serialization.JsonPropertyName("buyget_info")]
public Types.BuyGet? BuyGet { get; set; }
}
}
/// <summary>
/// 获取或设置优惠条件信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("discount_condition")]
[System.Text.Json.Serialization.JsonPropertyName("discount_condition")]
public Types.DiscountCondidtion? DiscountCondidtion { get; set; }
/// <summary>
/// 获取或设置满减金额(单位:分)。
/// </summary>
[Newtonsoft.Json.JsonProperty("discount_fee")]
[System.Text.Json.Serialization.JsonPropertyName("discount_fee")]
public int? DiscountFee { get; set; }
/// <summary>
/// 获取或设置折扣数值范围100010000
/// </summary>
[Newtonsoft.Json.JsonProperty("discount_num")]
[System.Text.Json.Serialization.JsonPropertyName("discount_num")]
public int? DiscountNumber { get; set; }
}
public class Promotion
{
public static class Types
{
public class Finder
{
/// <summary>
/// 获取或设置视频号昵称。
/// </summary>
[Newtonsoft.Json.JsonProperty("nickname")]
[System.Text.Json.Serialization.JsonPropertyName("nickname")]
public string? Nickname { get; set; }
}
}
/// <summary>
/// 获取或设置推广类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("promote_type")]
[System.Text.Json.Serialization.JsonPropertyName("promote_type")]
public int PromoteType { get; set; }
/// <summary>
/// 获取或设置推广视频号信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("finder")]
[System.Text.Json.Serialization.JsonPropertyName("finder")]
public Types.Finder? Finder { get; set; }
}
public class Reception : ProductCouponCreateRequest.Types.Reception
{
}
public class Validity : ProductCouponCreateRequest.Types.Validity
{
}
}
/// <summary>
/// 获取或设置优惠券名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("name")]
[System.Text.Json.Serialization.JsonPropertyName("name")]
public string Name { get; set; } = string.Empty;
/// <summary>
/// 获取或设置优惠信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("discount_info")]
[System.Text.Json.Serialization.JsonPropertyName("discount_info")]
public Types.Discount Discount { get; set; } = new Types.Discount();
/// <summary>
/// 获取或设置推广信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("promote_info")]
[System.Text.Json.Serialization.JsonPropertyName("promote_info")]
public Types.Promotion? Promotion { get; set; }
/// <summary>
/// 获取或设置接收信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("receive_info")]
[System.Text.Json.Serialization.JsonPropertyName("receive_info")]
public Types.Reception? Reception { get; set; }
/// <summary>
/// 获取或设置有效期信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("valid_info")]
[System.Text.Json.Serialization.JsonPropertyName("valid_info")]
public Types.Validity Validity { get; set; } = new Types.Validity();
}
}
/// <summary>
/// 获取或设置商家侧优惠券 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("out_coupon_id")]
[System.Text.Json.Serialization.JsonPropertyName("out_coupon_id")]
public string OutCouponId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置优惠券类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("type")]
[System.Text.Json.Serialization.JsonPropertyName("type")]
public int Type { get; set; }
/// <summary>
/// 获取或设置优惠券推广类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("promote_type")]
[System.Text.Json.Serialization.JsonPropertyName("promote_type")]
public int PromoteType { get; set; }
/// <summary>
/// 获取或设置优惠券信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("coupon_info")]
[System.Text.Json.Serialization.JsonPropertyName("coupon_info")]
public Types.CouponDetail CouponDetail { get; set; } = new Types.CouponDetail();
}
}
/// <summary>
/// 获取或设置优惠券信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("coupon")]
[System.Text.Json.Serialization.JsonPropertyName("coupon")]
public Types.Coupon Coupon { get; set; } = new Types.Coupon();
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /shop/coupon/add 接口的响应。</para>
/// </summary>
public class ShopCouponAddResponse : WechatApiResponse
{
}
}

View File

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /shop/coupon/get_list 接口的请求。</para>
/// </summary>
public class ShopCouponGetListRequest : WechatApiRequest
{
/// <summary>
/// 获取或设置分页起始位置。
/// </summary>
[Newtonsoft.Json.JsonProperty("offset")]
[System.Text.Json.Serialization.JsonPropertyName("offset")]
public int Offset { get; set; }
/// <summary>
/// 获取或设置分页每页数量。
/// </summary>
[Newtonsoft.Json.JsonProperty("page_size")]
[System.Text.Json.Serialization.JsonPropertyName("page_size")]
public int Limit { get; set; } = 10;
}
}

View File

@ -0,0 +1,103 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /shop/coupon/get_list 接口的响应。</para>
/// </summary>
public class ShopCouponGetListResponse : WechatApiResponse
{
public static class Types
{
public class Result
{
public static class Types
{
public class Coupon : ShopCouponGetResponse.Types.Result.Types.Coupon
{
}
public class CouponStock
{
public static class Types
{
public class Stock
{
/// <summary>
/// 获取或设置剩余量。
/// </summary>
[Newtonsoft.Json.JsonProperty("issued_num")]
[System.Text.Json.Serialization.JsonPropertyName("issued_num")]
public int IssuedNumber { get; set; }
/// <summary>
/// 获取或设置发放量。
/// </summary>
[Newtonsoft.Json.JsonProperty("receive_num")]
[System.Text.Json.Serialization.JsonPropertyName("receive_num")]
public int ReceiveNumber { get; set; }
}
}
/// <summary>
/// 获取或设置商家侧优惠券 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("out_coupon_id")]
[System.Text.Json.Serialization.JsonPropertyName("out_coupon_id")]
public string OutCouponId { get; set; } = default!;
/// <summary>
/// 获取或设置库存信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("stock_info")]
[System.Text.Json.Serialization.JsonPropertyName("stock_info")]
public Types.Stock Stock { get; set; } = default!;
/// <summary>
/// 获取或设置更新时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("update_time")]
[System.Text.Json.Serialization.JsonPropertyName("update_time")]
public long UpdateTimestamp { get; set; }
/// <summary>
/// 获取或设置创建时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("create_time")]
[System.Text.Json.Serialization.JsonPropertyName("create_time")]
public long CreateTimestamp { get; set; }
}
}
/// <summary>
/// 获取或设置优惠券信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("coupon")]
[System.Text.Json.Serialization.JsonPropertyName("coupon")]
public Types.Coupon Coupon { get; set; } = default!;
/// <summary>
/// 获取或设置优惠券库存信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("coupon_stock")]
[System.Text.Json.Serialization.JsonPropertyName("coupon_stock")]
public Types.CouponStock CouponStock { get; set; } = default!;
}
}
/// <summary>
/// 获取或设置返回结果。
/// </summary>
[Newtonsoft.Json.JsonProperty("result_list")]
[System.Text.Json.Serialization.JsonPropertyName("result_list")]
public Types.Result[] ResultList { get; set; } = default!;
/// <summary>
/// 获取或设置总数量。
/// </summary>
[Newtonsoft.Json.JsonProperty("total_num")]
[System.Text.Json.Serialization.JsonPropertyName("total_num")]
public int TotalCount { get; set; }
}
}

View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /shop/coupon/get 接口的请求。</para>
/// </summary>
public class ShopCouponGetRequest : WechatApiRequest
{
/// <summary>
/// 获取或设置商家侧优惠券 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("out_coupon_id")]
[System.Text.Json.Serialization.JsonPropertyName("out_coupon_id")]
public string OutCouponId { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,338 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /shop/coupon/get 接口的响应。</para>
/// </summary>
public class ShopCouponGetResponse : WechatApiResponse
{
public static class Types
{
public class Result
{
public static class Types
{
public class Coupon
{
public static class Types
{
public class CouponDetail
{
public static class Types
{
public class Discount
{
public static class Types
{
public class DiscountCondidtion
{
public static class Types
{
public class TradeIn
{
/// <summary>
/// 获取或设置商家自定义商品 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("out_product_id")]
[System.Text.Json.Serialization.JsonPropertyName("out_product_id")]
public string OutProductId { get; set; } = default!;
/// <summary>
/// 获取或设置换购金额(单位:分)。
/// </summary>
[Newtonsoft.Json.JsonProperty("price")]
[System.Text.Json.Serialization.JsonPropertyName("price")]
public int Price { get; set; }
}
public class BuyGet
{
/// <summary>
/// 获取或设置购买的商家自定义商品 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("buy_out_product_id")]
[System.Text.Json.Serialization.JsonPropertyName("buy_out_product_id")]
public string BuyOutProductId { get; set; } = default!;
/// <summary>
/// 获取或设置购买的商品数量。
/// </summary>
[Newtonsoft.Json.JsonProperty("buy_product_cnt")]
[System.Text.Json.Serialization.JsonPropertyName("buy_product_cnt")]
public int BuyProductCount { get; set; }
/// <summary>
/// 获取或设置赠送的商家自定义商品 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("get_out_product_id")]
[System.Text.Json.Serialization.JsonPropertyName("get_out_product_id")]
public string GetOutProductId { get; set; } = default!;
/// <summary>
/// 获取或设置赠送的商品数量。
/// </summary>
[Newtonsoft.Json.JsonProperty("get_product_cnt")]
[System.Text.Json.Serialization.JsonPropertyName("get_product_cnt")]
public int GetProductCount { get; set; }
}
}
/// <summary>
/// 获取或设置商品数量。
/// </summary>
[Newtonsoft.Json.JsonProperty("product_cnt")]
[System.Text.Json.Serialization.JsonPropertyName("product_cnt")]
public int? ProductCount { get; set; }
/// <summary>
/// 获取或设置商品价格(单位:分)。
/// </summary>
[Newtonsoft.Json.JsonProperty("product_price")]
[System.Text.Json.Serialization.JsonPropertyName("product_price")]
public int? ProductPrice { get; set; }
/// <summary>
/// 获取或设置商家自定义商品 ID 列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("out_product_ids")]
[System.Text.Json.Serialization.JsonPropertyName("out_product_ids")]
public string[]? ProductIdList { get; set; }
/// <summary>
/// 获取或设置换购信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("tradein_info")]
[System.Text.Json.Serialization.JsonPropertyName("tradein_info")]
public Types.TradeIn? TradeIn { get; set; }
/// <summary>
/// 获取或设置买赠券信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("buyget_info")]
[System.Text.Json.Serialization.JsonPropertyName("buyget_info")]
public Types.BuyGet? BuyGet { get; set; }
}
}
/// <summary>
/// 获取或设置优惠条件信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("discount_condition")]
[System.Text.Json.Serialization.JsonPropertyName("discount_condition")]
public Types.DiscountCondidtion? DiscountCondidtion { get; set; }
/// <summary>
/// 获取或设置满减金额(单位:分)。
/// </summary>
[Newtonsoft.Json.JsonProperty("discount_fee")]
[System.Text.Json.Serialization.JsonPropertyName("discount_fee")]
public int? DiscountFee { get; set; }
/// <summary>
/// 获取或设置折扣数值范围100010000
/// </summary>
[Newtonsoft.Json.JsonProperty("discount_num")]
[System.Text.Json.Serialization.JsonPropertyName("discount_num")]
public int? DiscountNumber { get; set; }
}
public class Promotion
{
public static class Types
{
public class Finder
{
/// <summary>
/// 获取或设置视频号昵称。
/// </summary>
[Newtonsoft.Json.JsonProperty("nickname")]
[System.Text.Json.Serialization.JsonPropertyName("nickname")]
public string? Nickname { get; set; }
}
}
/// <summary>
/// 获取或设置推广类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("promote_type")]
[System.Text.Json.Serialization.JsonPropertyName("promote_type")]
public int PromoteType { get; set; }
/// <summary>
/// 获取或设置推广视频号信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("finder")]
[System.Text.Json.Serialization.JsonPropertyName("finder")]
public Types.Finder? Finder { get; set; }
}
public class Reception
{
/// <summary>
/// 获取或设置单人限领数量。
/// </summary>
[Newtonsoft.Json.JsonProperty("limit_num_one_person")]
[System.Text.Json.Serialization.JsonPropertyName("limit_num_one_person")]
public int LimitPerUser { get; set; }
/// <summary>
/// 获取或设置领取总数量。
/// </summary>
[Newtonsoft.Json.JsonProperty("total_num")]
[System.Text.Json.Serialization.JsonPropertyName("total_num")]
public int TotalNumber { get; set; }
/// <summary>
/// 获取或设置领取开始时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("start_time")]
[System.Text.Json.Serialization.JsonPropertyName("start_time")]
public long StartTimestamp { get; set; }
/// <summary>
/// 获取或设置领取结束时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("end_time")]
[System.Text.Json.Serialization.JsonPropertyName("end_time")]
public long EndTimestamp { get; set; }
}
public class Validity
{
/// <summary>
/// 获取或设置有效期类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("valid_type")]
[System.Text.Json.Serialization.JsonPropertyName("valid_type")]
public int ValidType { get; set; }
/// <summary>
/// 获取或设置相对生效天数。
/// </summary>
[Newtonsoft.Json.JsonProperty("valid_day_num")]
[System.Text.Json.Serialization.JsonPropertyName("valid_day_num")]
public int? ValidDays { get; set; }
/// <summary>
/// 获取或设置绝对生效开始时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("start_time")]
[System.Text.Json.Serialization.JsonPropertyName("start_time")]
public long? StartTimestamp { get; set; }
/// <summary>
/// 获取或设置绝对生效结束时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("end_time")]
[System.Text.Json.Serialization.JsonPropertyName("end_time")]
public long? EndTimestamp { get; set; }
}
}
/// <summary>
/// 获取或设置优惠券名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("name")]
[System.Text.Json.Serialization.JsonPropertyName("name")]
public string Name { get; set; } = default!;
/// <summary>
/// 获取或设置优惠信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("discount_info")]
[System.Text.Json.Serialization.JsonPropertyName("discount_info")]
public Types.Discount Discount { get; set; } = default!;
/// <summary>
/// 获取或设置推广信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("promote_info")]
[System.Text.Json.Serialization.JsonPropertyName("promote_info")]
public Types.Promotion? Promotion { get; set; }
/// <summary>
/// 获取或设置接收信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("receive_info")]
[System.Text.Json.Serialization.JsonPropertyName("receive_info")]
public Types.Reception? Reception { get; set; }
/// <summary>
/// 获取或设置有效期信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("valid_info")]
[System.Text.Json.Serialization.JsonPropertyName("valid_info")]
public Types.Validity Validity { get; set; } = default!;
}
}
/// <summary>
/// 获取或设置商家侧优惠券 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("out_coupon_id")]
[System.Text.Json.Serialization.JsonPropertyName("out_coupon_id")]
public string OutCouponId { get; set; } = default!;
/// <summary>
/// 获取或设置优惠券类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("type")]
[System.Text.Json.Serialization.JsonPropertyName("type")]
public int Type { get; set; }
/// <summary>
/// 获取或设置优惠券推广类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("promote_type")]
[System.Text.Json.Serialization.JsonPropertyName("promote_type")]
public int PromoteType { get; set; }
/// <summary>
/// 获取或设置优惠券信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("coupon_info")]
[System.Text.Json.Serialization.JsonPropertyName("coupon_info")]
public Types.CouponDetail CouponDetail { get; set; } = default!;
/// <summary>
/// 获取或设置优惠券状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("status")]
[System.Text.Json.Serialization.JsonPropertyName("status")]
public int Status { get; set; }
/// <summary>
/// 获取或设置更新时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("update_time")]
[System.Text.Json.Serialization.JsonPropertyName("update_time")]
public long UpdateTimestamp { get; set; }
/// <summary>
/// 获取或设置创建时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("create_time")]
[System.Text.Json.Serialization.JsonPropertyName("create_time")]
public long CreateTimestamp { get; set; }
}
}
/// <summary>
/// 获取或设置优惠券信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("coupon")]
[System.Text.Json.Serialization.JsonPropertyName("coupon")]
public Types.Coupon Coupon { get; set; } = default!;
}
}
/// <summary>
/// 获取或设置返回结果。
/// </summary>
[Newtonsoft.Json.JsonProperty("result")]
[System.Text.Json.Serialization.JsonPropertyName("result")]
public Types.Result Result { get; set; } = default!;
}
}

View File

@ -0,0 +1,58 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /shop/coupon/update_coupon_stock 接口的请求。</para>
/// </summary>
public class ShopCouponUpdateCouponStockRequest : WechatApiRequest
{
public static class Types
{
public class CouponStock
{
public static class Types
{
public class Stock
{
/// <summary>
/// 获取或设置剩余量。
/// </summary>
[Newtonsoft.Json.JsonProperty("issued_num")]
[System.Text.Json.Serialization.JsonPropertyName("issued_num")]
public int IssuedNumber { get; set; }
/// <summary>
/// 获取或设置发放量。
/// </summary>
[Newtonsoft.Json.JsonProperty("receive_num")]
[System.Text.Json.Serialization.JsonPropertyName("receive_num")]
public int ReceiveNumber { get; set; }
}
}
/// <summary>
/// 获取或设置商家侧优惠券 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("out_coupon_id")]
[System.Text.Json.Serialization.JsonPropertyName("out_coupon_id")]
public string OutCouponId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置库存信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("stock_info")]
[System.Text.Json.Serialization.JsonPropertyName("stock_info")]
public Types.Stock Stock { get; set; } = new Types.Stock();
}
}
/// <summary>
/// 获取或设置优惠券库存信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("coupon_stock")]
[System.Text.Json.Serialization.JsonPropertyName("coupon_stock")]
public Types.CouponStock CouponStock { get; set; } = new Types.CouponStock();
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /shop/coupon/update_coupon_stock 接口的响应。</para>
/// </summary>
public class ShopCouponUpdateCouponStockResponse : WechatApiResponse
{
}
}

View File

@ -0,0 +1,204 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /shop/coupon/update 接口的请求。</para>
/// </summary>
public class ShopCouponUpdateRequest : WechatApiRequest
{
public static class Types
{
public class Coupon
{
public static class Types
{
public class CouponDetail
{
public static class Types
{
public class Discount
{
public static class Types
{
public class DiscountCondidtion
{
public static class Types
{
public class TradeIn : ShopCouponAddRequest.Types.Coupon.Types.CouponDetail.Types.Discount.Types.DiscountCondidtion.Types.TradeIn
{
}
public class BuyGet : ShopCouponAddRequest.Types.Coupon.Types.CouponDetail.Types.Discount.Types.DiscountCondidtion.Types.BuyGet
{
}
}
/// <summary>
/// 获取或设置商品数量。
/// </summary>
[Newtonsoft.Json.JsonProperty("product_cnt")]
[System.Text.Json.Serialization.JsonPropertyName("product_cnt")]
public int? ProductCount { get; set; }
/// <summary>
/// 获取或设置商品价格(单位:分)。
/// </summary>
[Newtonsoft.Json.JsonProperty("product_price")]
[System.Text.Json.Serialization.JsonPropertyName("product_price")]
public int? ProductPrice { get; set; }
/// <summary>
/// 获取或设置商家自定义商品 ID 列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("out_product_ids")]
[System.Text.Json.Serialization.JsonPropertyName("out_product_ids")]
public IList<string>? ProductIdList { get; set; }
/// <summary>
/// 获取或设置换购信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("tradein_info")]
[System.Text.Json.Serialization.JsonPropertyName("tradein_info")]
public Types.TradeIn? TradeIn { get; set; }
/// <summary>
/// 获取或设置买赠券信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("buyget_info")]
[System.Text.Json.Serialization.JsonPropertyName("buyget_info")]
public Types.BuyGet? BuyGet { get; set; }
}
}
/// <summary>
/// 获取或设置优惠条件信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("discount_condition")]
[System.Text.Json.Serialization.JsonPropertyName("discount_condition")]
public Types.DiscountCondidtion? DiscountCondidtion { get; set; }
/// <summary>
/// 获取或设置满减金额(单位:分)。
/// </summary>
[Newtonsoft.Json.JsonProperty("discount_fee")]
[System.Text.Json.Serialization.JsonPropertyName("discount_fee")]
public int? DiscountFee { get; set; }
/// <summary>
/// 获取或设置折扣数值范围100010000
/// </summary>
[Newtonsoft.Json.JsonProperty("discount_num")]
[System.Text.Json.Serialization.JsonPropertyName("discount_num")]
public int? DiscountNumber { get; set; }
}
public class Promotion
{
public static class Types
{
public class Finder : ShopCouponAddRequest.Types.Coupon.Types.CouponDetail.Types.Promotion.Types.Finder
{
}
}
/// <summary>
/// 获取或设置推广类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("promote_type")]
[System.Text.Json.Serialization.JsonPropertyName("promote_type")]
public int PromoteType { get; set; }
/// <summary>
/// 获取或设置推广视频号信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("finder")]
[System.Text.Json.Serialization.JsonPropertyName("finder")]
public Types.Finder? Finder { get; set; }
}
public class Reception : ShopCouponAddRequest.Types.Coupon.Types.CouponDetail.Types.Reception
{
}
public class Validity : ShopCouponAddRequest.Types.Coupon.Types.CouponDetail.Types.Validity
{
}
}
/// <summary>
/// 获取或设置优惠券名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("name")]
[System.Text.Json.Serialization.JsonPropertyName("name")]
public string Name { get; set; } = string.Empty;
/// <summary>
/// 获取或设置优惠信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("discount_info")]
[System.Text.Json.Serialization.JsonPropertyName("discount_info")]
public Types.Discount Discount { get; set; } = new Types.Discount();
/// <summary>
/// 获取或设置推广信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("promote_info")]
[System.Text.Json.Serialization.JsonPropertyName("promote_info")]
public Types.Promotion? Promotion { get; set; }
/// <summary>
/// 获取或设置接收信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("receive_info")]
[System.Text.Json.Serialization.JsonPropertyName("receive_info")]
public Types.Reception? Reception { get; set; }
/// <summary>
/// 获取或设置有效期信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("valid_info")]
[System.Text.Json.Serialization.JsonPropertyName("valid_info")]
public Types.Validity Validity { get; set; } = new Types.Validity();
}
}
/// <summary>
/// 获取或设置商家侧优惠券 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("out_coupon_id")]
[System.Text.Json.Serialization.JsonPropertyName("out_coupon_id")]
public string OutCouponId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置优惠券类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("type")]
[System.Text.Json.Serialization.JsonPropertyName("type")]
public int Type { get; set; }
/// <summary>
/// 获取或设置优惠券推广类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("promote_type")]
[System.Text.Json.Serialization.JsonPropertyName("promote_type")]
public int PromoteType { get; set; }
/// <summary>
/// 获取或设置优惠券信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("coupon_info")]
[System.Text.Json.Serialization.JsonPropertyName("coupon_info")]
public Types.CouponDetail CouponDetail { get; set; } = new Types.CouponDetail();
}
}
/// <summary>
/// 获取或设置优惠券信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("coupon")]
[System.Text.Json.Serialization.JsonPropertyName("coupon")]
public Types.Coupon Coupon { get; set; } = new Types.Coupon();
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /shop/coupon/update 接口的响应。</para>
/// </summary>
public class ShopCouponUpdateResponse : WechatApiResponse
{
}
}

View File

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /shop/coupon/update_status 接口的请求。</para>
/// </summary>
public class ShopCouponUpdateStatusRequest : WechatApiRequest
{
/// <summary>
/// 获取或设置商家侧优惠券 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("out_coupon_id")]
[System.Text.Json.Serialization.JsonPropertyName("out_coupon_id")]
public string OutCouponId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置优惠券状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("status")]
[System.Text.Json.Serialization.JsonPropertyName("status")]
public int Status { get; set; }
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /shop/coupon/update_status 接口的响应。</para>
/// </summary>
public class ShopCouponUpdateStatusResponse : WechatApiResponse
{
}
}

View File

@ -0,0 +1,59 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /shop/coupon/add_user_coupon 接口的请求。</para>
/// </summary>
public class ShopCouponAddUserCouponRequest : WechatApiRequest
{
public static class Types
{
public class UserCoupon
{
/// <summary>
/// 获取或设置商家侧用户优惠券 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("out_user_coupon_id")]
[System.Text.Json.Serialization.JsonPropertyName("out_user_coupon_id")]
public string OutUserCouponId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置商家侧优惠券 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("out_coupon_id")]
[System.Text.Json.Serialization.JsonPropertyName("out_coupon_id")]
public string OutCouponId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置用户优惠券状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("status")]
[System.Text.Json.Serialization.JsonPropertyName("status")]
public int Status { get; set; }
}
}
/// <summary>
/// 获取或设置用户 OpenId。
/// </summary>
[Newtonsoft.Json.JsonProperty("openid")]
[System.Text.Json.Serialization.JsonPropertyName("openid")]
public string OpenId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置优惠券库存信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("user_coupon")]
[System.Text.Json.Serialization.JsonPropertyName("user_coupon")]
public Types.UserCoupon UserCoupon { get; set; } = new Types.UserCoupon();
/// <summary>
/// 获取或设置领取时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("recv_time")]
[System.Text.Json.Serialization.JsonPropertyName("recv_time")]
public long ReceiveTimestamp { get; set; }
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /shop/coupon/add_user_coupon 接口的响应。</para>
/// </summary>
public class ShopCouponAddUserCouponResponse : WechatApiResponse
{
}
}

View File

@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /shop/coupon/get_usercoupon_list 接口的请求。</para>
/// </summary>
public class ShopCouponGetUserCouponListRequest : WechatApiRequest
{
/// <summary>
/// 获取或设置用户 OpenId。
/// </summary>
[Newtonsoft.Json.JsonProperty("openid")]
[System.Text.Json.Serialization.JsonPropertyName("openid")]
public string OpenId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置分页起始位置。
/// </summary>
[Newtonsoft.Json.JsonProperty("offset")]
[System.Text.Json.Serialization.JsonPropertyName("offset")]
public int Offset { get; set; }
/// <summary>
/// 获取或设置分页每页数量。
/// </summary>
[Newtonsoft.Json.JsonProperty("page_size")]
[System.Text.Json.Serialization.JsonPropertyName("page_size")]
public int Limit { get; set; } = 10;
}
}

View File

@ -0,0 +1,107 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /shop/coupon/get_usercoupon_list 接口的响应。</para>
/// </summary>
public class ShopCouponGetUserCouponListResponse : WechatApiResponse
{
public static class Types
{
public class Result
{
public static class Types
{
public class Extra
{
/// <summary>
/// 获取或设置用户优惠券核销时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("use_time")]
[System.Text.Json.Serialization.JsonPropertyName("use_time")]
public long? UseTimestamp { get; set; }
}
}
/// <summary>
/// 获取或设置用户 OpenId。
/// </summary>
[Newtonsoft.Json.JsonProperty("openid")]
[System.Text.Json.Serialization.JsonPropertyName("openid")]
public string OpenId { get; set; } = default!;
/// <summary>
/// 获取或设置商家侧用户优惠券 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("out_user_coupon_id")]
[System.Text.Json.Serialization.JsonPropertyName("out_user_coupon_id")]
public string OutUserCouponId { get; set; } = default!;
/// <summary>
/// 获取或设置商家侧优惠券 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("out_coupon_id")]
[System.Text.Json.Serialization.JsonPropertyName("out_coupon_id")]
public string OutCouponId { get; set; } = default!;
/// <summary>
/// 获取或设置状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("status")]
[System.Text.Json.Serialization.JsonPropertyName("status")]
public int Status { get; set; }
/// <summary>
/// 获取或设置优惠券扩展信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("ext_info")]
[System.Text.Json.Serialization.JsonPropertyName("ext_info")]
public Types.Extra Extra { get; set; } = default!;
/// <summary>
/// 获取或设置有效开始时间。
/// </summary>
[Newtonsoft.Json.JsonProperty("start_time")]
[System.Text.Json.Serialization.JsonPropertyName("start_time")]
public long? StartTimestamp { get; set; }
/// <summary>
/// 获取或设置有效结束时间。
/// </summary>
[Newtonsoft.Json.JsonProperty("end_time")]
[System.Text.Json.Serialization.JsonPropertyName("end_time")]
public long? EndTimestamp { get; set; }
/// <summary>
/// 获取或设置创建时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("create_time")]
[System.Text.Json.Serialization.JsonPropertyName("create_time")]
public long CreateTimestamp { get; set; }
/// <summary>
/// 获取或设置更新时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("update_time")]
[System.Text.Json.Serialization.JsonPropertyName("update_time")]
public long UpdateTimestamp { get; set; }
}
}
/// <summary>
/// 获取或设置返回结果。
/// </summary>
[Newtonsoft.Json.JsonProperty("result_list")]
[System.Text.Json.Serialization.JsonPropertyName("result_list")]
public Types.Result[] ResultList { get; set; } = default!;
/// <summary>
/// 获取或设置总数量。
/// </summary>
[Newtonsoft.Json.JsonProperty("total_num")]
[System.Text.Json.Serialization.JsonPropertyName("total_num")]
public int TotalCount { get; set; }
}
}

View File

@ -0,0 +1,72 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /shop/coupon/update_user_coupon 接口的请求。</para>
/// </summary>
public class ShopCouponUpdateUserCouponRequest : WechatApiRequest
{
public static class Types
{
public class UserCoupon
{
public static class Types
{
public class Extra
{
/// <summary>
/// 获取或设置用户优惠券核销时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("use_time")]
[System.Text.Json.Serialization.JsonPropertyName("use_time")]
public long? UseTimestamp { get; set; }
}
}
/// <summary>
/// 获取或设置商家侧用户优惠券 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("out_user_coupon_id")]
[System.Text.Json.Serialization.JsonPropertyName("out_user_coupon_id")]
public string OutUserCouponId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置商家侧优惠券 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("out_coupon_id")]
[System.Text.Json.Serialization.JsonPropertyName("out_coupon_id")]
public string OutCouponId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置优惠券扩展信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("ext_info")]
[System.Text.Json.Serialization.JsonPropertyName("ext_info")]
public Types.Extra Extra { get; set; } = new Types.Extra();
}
}
/// <summary>
/// 获取或设置用户 OpenId。
/// </summary>
[Newtonsoft.Json.JsonProperty("openid")]
[System.Text.Json.Serialization.JsonPropertyName("openid")]
public string OpenId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置优惠券库存信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("user_coupon")]
[System.Text.Json.Serialization.JsonPropertyName("user_coupon")]
public Types.UserCoupon UserCoupon { get; set; } = new Types.UserCoupon();
/// <summary>
/// 获取或设置领取时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("recv_time")]
[System.Text.Json.Serialization.JsonPropertyName("recv_time")]
public long ReceiveTimestamp { get; set; }
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /shop/coupon/update_user_coupon 接口的响应。</para>
/// </summary>
public class ShopCouponUpdateUserCouponResponse : WechatApiResponse
{
}
}

View File

@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /shop/coupon/update_usercoupon_status 接口的请求。</para>
/// </summary>
public class ShopCouponUpdateUserCouponStatusRequest : WechatApiRequest
{
/// <summary>
/// 获取或设置用户 OpenId。
/// </summary>
[Newtonsoft.Json.JsonProperty("openid")]
[System.Text.Json.Serialization.JsonPropertyName("openid")]
public string OpenId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置商家侧用户优惠券 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("out_user_coupon_id")]
[System.Text.Json.Serialization.JsonPropertyName("out_user_coupon_id")]
public string OutUserCouponId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置商家侧优惠券 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("out_coupon_id")]
[System.Text.Json.Serialization.JsonPropertyName("out_coupon_id")]
public string OutCouponId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置用户优惠券状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("status")]
[System.Text.Json.Serialization.JsonPropertyName("status")]
public int Status { get; set; }
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /shop/coupon/update_usercoupon_status 接口的响应。</para>
/// </summary>
public class ShopCouponUpdateUserCouponStatusResponse : WechatApiResponse
{
}
}

View File

@ -0,0 +1,50 @@
{
"coupon": {
"out_coupon_id": "coupon_id_1",
"type": 101,
"promote_type": 4,
"coupon_info": {
"name": "示例优惠券",
"promote_info": {
"promote_type": 4,
"finder": {
"nickname": "视频号昵称"
}
},
"discount_info": {
"discount_condition": {
"product_cnt": 2,
"product_price": 5000,
"out_product_ids": [
"product_id_3",
"product_id_4"
],
"tradein_info": {
"out_product_id": "product_id_5",
"price": 10000
},
"buyget_info": {
"buy_out_product_id": "product_id_1",
"buy_product_cnt": 3,
"get_out_product_id": "product_id_2",
"get_product_cnt": 2131241242
}
},
"discount_num": 9800,
"discount_fee": 6400
},
"receive_info": {
"start_time": 1625451250,
"end_time": 1625454250,
"limit_num_one_person": 10,
"total_num": 100
},
"valid_info": {
"valid_type": 1,
"valid_day_num": 10,
"start_time": "1625451250",
"end_time": "1625464250"
}
}
}
}

View File

@ -0,0 +1,4 @@
{
"page_size": 3,
"offset": 2
}

View File

@ -0,0 +1,114 @@
{
"errcode": 0,
"total_num": 10,
"result_list": [
{
"coupon": {
"out_coupon_id": "out_coupon_id_3",
"type": 101,
"promote_type": 4,
"coupon_info": {
"name": "测试3",
"promote_info": {
"promote_type": 4,
"finder": {}
},
"receive_info": {
"total_num": 100
}
},
"status": 0,
"create_time": 1625218450,
"update_time": 1625238573
},
"coupon_stock": {
"out_coupon_id": "out_coupon_id_3",
"stock_info": {
"issued_num": 99,
"receive_num": 1
},
"create_time": 1625226181,
"update_time": 1625237877
}
},
{
"coupon": {
"out_coupon_id": "out_coupon_id_4",
"type": 101,
"promote_type": 4,
"coupon_info": {
"name": "测试4",
"promote_info": {
"promote_type": 4,
"finder": {}
},
"receive_info": {
"total_num": 1000
}
},
"status": 1,
"create_time": 1625239595,
"update_time": 1625239595
}
},
{
"coupon": {
"out_coupon_id": "coupon_id_1",
"type": 101,
"promote_type": 4,
"coupon_info": {
"name": "示例优惠券",
"promote_info": {
"promote_type": 4,
"finder": {
"nickname": "视频号昵称"
}
},
"discount_info": {
"discount_condition": {
"product_cnt": 2,
"product_price": 5000,
"out_product_ids": [ "product_id_3", "product_id_4" ],
"tradein_info": {
"out_product_id": "product_id_5",
"price": 10000
},
"buyget_info": {
"buy_out_product_id": "product_id_1",
"buy_product_cnt": 3,
"get_out_product_id": "product_id_2",
"get_product_cnt": 2131241242
}
},
"discount_num": 9800,
"discount_fee": 6400
},
"receive_info": {
"start_time": 1625451250,
"end_time": 1625454250,
"limit_num_one_person": 10,
"total_num": 100
},
"valid_info": {
"valid_type": 1,
"valid_day_num": 10,
"start_time": 1625451250,
"end_time": 1625464250
}
},
"status": 2,
"create_time": 1625454641,
"update_time": 1625473652
},
"coupon_stock": {
"out_coupon_id": "coupon_id_1",
"stock_info": {
"issued_num": 99,
"receive_num": 1
},
"create_time": 1625473652,
"update_time": 1625474308
}
}
]
}

View File

@ -0,0 +1,3 @@
{
"out_coupon_id": "out_coupon_id_1"
}

View File

@ -0,0 +1,53 @@
{
"errcode": 0,
"result": {
"coupon": {
"out_coupon_id": "coupon_id_1",
"type": 101,
"promote_type": 4,
"coupon_info": {
"name": "示例优惠券",
"promote_info": {
"promote_type": 4,
"finder": {
"nickname": "视频号昵称"
}
},
"discount_info": {
"discount_condition": {
"product_cnt": 2,
"product_price": 5000,
"out_product_ids": [ "product_id_3", "product_id_4" ],
"tradein_info": {
"out_product_id": "product_id_5",
"price": 10000
},
"buyget_info": {
"buy_out_product_id": "product_id_1",
"buy_product_cnt": 3,
"get_out_product_id": "product_id_2",
"get_product_cnt": 2131241242
}
},
"discount_num": 9800,
"discount_fee": 6400
},
"receive_info": {
"start_time": 1625451250,
"end_time": 1625454250,
"limit_num_one_person": 10,
"total_num": 100
},
"valid_info": {
"valid_type": 1,
"valid_day_num": 10,
"start_time": 1625451250,
"end_time": 1625464250
}
},
"status": 1,
"create_time": 1625454641,
"update_time": 1625454641
}
}
}

View File

@ -0,0 +1,9 @@
{
"coupon_stock": {
"out_coupon_id": "coupon_id_1",
"stock_info": {
"issued_num": 60,
"receive_num": 40
}
}
}

View File

@ -0,0 +1,47 @@
{
"coupon": {
"out_coupon_id": "coupon_id_1",
"type": 101,
"promote_type": 4,
"coupon_info": {
"name": "示例优惠券",
"promote_info": {
"promote_type": 4,
"finder": {
"nickname": "视频号昵称"
}
},
"discount_info": {
"discount_condition": {
"product_cnt": 2,
"product_price": 5000,
"out_product_ids": [ "product_id_3", "product_id_4" ],
"tradein_info": {
"out_product_id": "product_id_5",
"price": 10000
},
"buyget_info": {
"buy_out_product_id": "product_id_1",
"buy_product_cnt": 3,
"get_out_product_id": "product_id_2",
"get_product_cnt": 2131241242
}
},
"discount_num": 9800,
"discount_fee": 6400
},
"receive_info": {
"start_time": 1625451250,
"end_time": 1625454250,
"limit_num_one_person": 10,
"total_num": 100
},
"valid_info": {
"valid_type": 1,
"valid_day_num": 10,
"start_time": 1625451250,
"end_time": 1625464250
}
}
}
}

View File

@ -0,0 +1,4 @@
{
"out_coupon_id": "12345678",
"status": 2
}

View File

@ -0,0 +1,9 @@
{
"openid": "oIJ9d5Ad4JMhbybqJ3_J73LkR_Io",
"user_coupon": {
"out_user_coupon_id": "user_coupon_id_1",
"out_coupon_id": "coupon_id_1",
"status": 100
},
"recv_time": 1628147893
}

View File

@ -0,0 +1,5 @@
{
"page_size": 2,
"offset": 1,
"openid": "oIJ9d5Ad4JMhbybqJ3_J73LkR_Io"
}

View File

@ -0,0 +1,30 @@
{
"errcode": 0,
"total_num": 3,
"result_list": [
{
"out_user_coupon_id": "out_user_coupon_id_1",
"openid": "oIJ9d5Ad4JMhbybqJ3_J73LkR_Io",
"out_coupon_id": "coupon_id_1",
"status": 100,
"create_time": 1625474308,
"update_time": 1625474308,
"end_time": 1625464250,
"ext_info": {},
"start_time": 1625451250
},
{
"out_user_coupon_id": "out_user_coupon_id_2",
"openid": "oIJ9d5Ad4JMhbybqJ3_J73LkR_Io",
"out_coupon_id": "out_coupon_id_3",
"status": 102,
"create_time": 1625237877,
"update_time": 1625237997,
"end_time": 0,
"ext_info": {
"use_time": 1625237997
},
"start_time": 0
}
]
}

View File

@ -0,0 +1,11 @@
{
"openid": "oIJ9d5Ad4JMhbybqJ3_J73LkR_Io",
"user_coupon": {
"out_user_coupon_id": "out_user_coupon_id_1",
"out_coupon_id": "out_coupon_id_3",
"ext_info": {
"use_time": 1628139497
}
},
"recv_time": 1628147893
}

View File

@ -0,0 +1,6 @@
{
"openid": "oIJ9d5Ad4JMhbybqJ3_J73LkR_Io",
"out_coupon_id": "coupon_id_1",
"out_user_coupon_id": "user_coupon_id_1",
"status": 102
}