diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteChannelsExtensions.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteChannelsExtensions.cs index 494e6e83..a276e996 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteChannelsExtensions.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteChannelsExtensions.cs @@ -5767,6 +5767,31 @@ namespace SKIT.FlurlHttpClient.Wechat.Api } #endregion + #region ECProduct/AuditQuota + /// + /// 异步调用 [POST] /channels/ec/product/getauditquota 接口。 + /// + /// REF:
+ /// + ///
+ ///
+ /// + /// + /// + /// + public static async Task ExecuteChannelsECProductGetAuditQuotaAsync(this WechatApiClient client, Models.ChannelsECProductGetAuditQuotaRequest 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 + .CreateFlurlRequest(request, HttpMethod.Post, "channels", "ec", "product", "getauditquota") + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); + } + #endregion + #region ECProduct/AuditStrategy /// /// 异步调用 [POST] /channels/ec/product/auditstrategy/get 接口。 diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECProduct/AuditQuota/ChannelsECProductGetAuditQuotaRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECProduct/AuditQuota/ChannelsECProductGetAuditQuotaRequest.cs new file mode 100644 index 00000000..2a54d2c3 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECProduct/AuditQuota/ChannelsECProductGetAuditQuotaRequest.cs @@ -0,0 +1,9 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /channels/ec/product/getauditquota 接口的请求。 + /// + public class ChannelsECProductGetAuditQuotaRequest : WechatApiRequest, IInferable + { + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECProduct/AuditQuota/ChannelsECProductGetAuditQuotaResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECProduct/AuditQuota/ChannelsECProductGetAuditQuotaResponse.cs new file mode 100644 index 00000000..d29151d6 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECProduct/AuditQuota/ChannelsECProductGetAuditQuotaResponse.cs @@ -0,0 +1,42 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /channels/ec/product/getauditquota 接口的响应。 + /// + public class ChannelsECProductGetAuditQuotaResponse : WechatApiResponse + { + public static class Types + { + public class AuditQuota + { + /// + /// 获取或设置是否已被限制。 + /// + [Newtonsoft.Json.JsonProperty("block_status")] + [System.Text.Json.Serialization.JsonPropertyName("block_status")] + public bool IsBlocked { get; set; } + + /// + /// 获取或设置可用配额。 + /// + [Newtonsoft.Json.JsonProperty("avail_quota")] + [System.Text.Json.Serialization.JsonPropertyName("avail_quota")] + public int AvailableQuota { get; set; } + + /// + /// 获取或设置总配额。 + /// + [Newtonsoft.Json.JsonProperty("total_quota")] + [System.Text.Json.Serialization.JsonPropertyName("total_quota")] + public int TotalQuota { get; set; } + } + } + + /// + /// 获取或设置审核限额信息。 + /// + [Newtonsoft.Json.JsonProperty("audit_quota")] + [System.Text.Json.Serialization.JsonPropertyName("audit_quota")] + public Types.AuditQuota AuditQuota { get; set; } = default!; + } +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECProduct/AuditQuota/ChannelsECProductGetAuditQuotaResponse.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECProduct/AuditQuota/ChannelsECProductGetAuditQuotaResponse.json new file mode 100644 index 00000000..df6b9849 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECProduct/AuditQuota/ChannelsECProductGetAuditQuotaResponse.json @@ -0,0 +1,9 @@ +{ + "errcode": 0, + "errmsg": "ok", + "audit_quota": { + "block_status": false, + "avail_quota": 1000, + "total_quota": 4000 + } +}