feat(wxapi): 新增小程序付费管理相关接口

This commit is contained in:
Fu Diwei
2023-08-28 10:03:13 +08:00
parent f93d6139d1
commit 3635157058
7 changed files with 763 additions and 490 deletions

View File

@@ -0,0 +1,15 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [GET] /wxa/charge/usage/get_recent_average 接口的请求。</para>
/// </summary>
public class WxaChargeUsageGetRecentAverageRequest : WechatApiRequest, IInferable<WxaChargeUsageGetRecentAverageRequest, WxaChargeUsageGetRecentAverageResponse>
{
/// <summary>
/// 获取或设置商品 SPU ID。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string SPUId { get; set; } = string.Empty;
}
}

View File

@@ -0,0 +1,16 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [GET] /wxa/charge/usage/get_recent_average 接口的响应。</para>
/// </summary>
public class WxaChargeUsageGetRecentAverageResponse : WechatApiResponse
{
/// <summary>
/// 获取或设置最近月平均用量。
/// </summary>
[Newtonsoft.Json.JsonProperty("averageData")]
[System.Text.Json.Serialization.JsonPropertyName("averageData")]
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
public long AverageData { get; set; }
}
}

View File

@@ -0,0 +1,30 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [GET] /wxa/charge/usage/get 接口的请求。</para>
/// </summary>
public class WxaChargeUsageGetRequest : WechatApiRequest, IInferable<WxaChargeUsageGetRequest, WxaChargeUsageGetResponse>
{
/// <summary>
/// 获取或设置商品 SPU ID。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string SPUId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置分页起始位置。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public int Offset { get; set; }
/// <summary>
/// 获取或设置分页每页数量。
/// <para>默认值20</para>
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public int Limit { get; set; } = 20;
}
}

View File

@@ -0,0 +1,131 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [GET] /wxa/charge/usage/get 接口的响应。</para>
/// </summary>
public class WxaChargeUsageGetResponse : WechatApiResponse
{
public static class Types
{
public class Detail
{
/// <summary>
/// 获取或设置资源包 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("pkgId")]
[System.Text.Json.Serialization.JsonPropertyName("pkgId")]
public string PackageId { get; set; } = default!;
/// <summary>
/// 获取或设置额度来源的商品 SPU ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("spuId")]
[System.Text.Json.Serialization.JsonPropertyName("spuId")]
public string SPUId { get; set; } = default!;
/// <summary>
/// 获取或设置额度来源的商品 SKU ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("skuId")]
[System.Text.Json.Serialization.JsonPropertyName("skuId")]
public string? SKUId { get; set; }
/// <summary>
/// 获取或设置资源包状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("status")]
[System.Text.Json.Serialization.JsonPropertyName("status")]
public int Status { get; set; }
/// <summary>
/// 获取或设置额度有效期开始时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("startTime")]
[System.Text.Json.Serialization.JsonPropertyName("startTime")]
public long StartTimestamp { get; set; }
/// <summary>
/// 获取或设置额度有效期结束时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("endTime")]
[System.Text.Json.Serialization.JsonPropertyName("endTime")]
public long EndTimestamp { get; set; }
/// <summary>
/// 获取或设置额度容量。
/// </summary>
[Newtonsoft.Json.JsonProperty("all")]
[System.Text.Json.Serialization.JsonPropertyName("all")]
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
public long AllQuota { get; set; }
/// <summary>
/// 获取或设置使用额度。
/// </summary>
[Newtonsoft.Json.JsonProperty("used")]
[System.Text.Json.Serialization.JsonPropertyName("used")]
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
public long UsedQuota { get; set; }
/// <summary>
/// 获取或设置额度来源。
/// </summary>
[Newtonsoft.Json.JsonProperty("source")]
[System.Text.Json.Serialization.JsonPropertyName("source")]
public int? Source { get; set; }
}
}
/// <summary>
/// 获取或设置资源可用总量。
/// </summary>
[Newtonsoft.Json.JsonProperty("all")]
[System.Text.Json.Serialization.JsonPropertyName("all")]
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
public long AllQuota { get; set; }
/// <summary>
/// 获取或设置资源总量。
/// </summary>
[Newtonsoft.Json.JsonProperty("effectiveAll")]
[System.Text.Json.Serialization.JsonPropertyName("effectiveAll")]
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
public long EffectiveAllQuota { get; set; }
/// <summary>
/// 获取或设置累计用量。
/// </summary>
[Newtonsoft.Json.JsonProperty("effectiveUse")]
[System.Text.Json.Serialization.JsonPropertyName("effectiveUse")]
[System.Text.Json.Serialization.JsonNumberHandling(System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString)]
public long EffectiveUsedQuota { get; set; }
/// <summary>
/// 获取或设置订阅开始时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("startServiceTime")]
[System.Text.Json.Serialization.JsonPropertyName("startServiceTime")]
public long StartServiceTime { get; set; }
/// <summary>
/// 获取或设置订阅结束时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("endServiceTime")]
[System.Text.Json.Serialization.JsonPropertyName("endServiceTime")]
public long EndServiceTime { get; set; }
/// <summary>
/// 获取或设置用量详情列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("detailList")]
[System.Text.Json.Serialization.JsonPropertyName("detailList")]
public Types.Detail[] DetailList { get; set; } = default!;
/// <summary>
/// 获取或设置用量详情总数量。
/// </summary>
[Newtonsoft.Json.JsonProperty("total")]
[System.Text.Json.Serialization.JsonPropertyName("total")]
public int TotalCount { get; set; }
}
}

View File

@@ -0,0 +1,4 @@
{
"errcode": 0,
"averageData": 260000
}

View File

@@ -0,0 +1,31 @@
{
"errcode": 0,
"all": "10",
"effectiveAll": "10",
"effectiveUse": "0",
"startServiceTime": 1669129510,
"endServiceTime": 1709450190,
"total": 2,
"detailList": [
{
"pkgId": "ZY2823973277692477440",
"startTime": 1677914190,
"endTime": 1709450190,
"used": "0",
"all": "4",
"status": 1,
"spuId": "10000057",
"skuId": "20000059"
},
{
"pkgId": "ZY2676590816357400576",
"startTime": 1669129510,
"endTime": 1700665510,
"used": "0",
"all": "6",
"status": 1,
"spuId": "10000057",
"skuId": "20000060"
}
]
}