mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2026-02-10 09:46:19 +08:00
feat(wxapi): 新增微信小店商品上架策略相关接口
This commit is contained in:
@@ -5619,6 +5619,54 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ECProduct/AuditStrategy
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /channels/ec/product/auditstrategy/get 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/shop/API/channels-shop-product/shop/api_getproductauditstrategy.html ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.ChannelsECProductAuditStrategyGetResponse> ExecuteChannelsECProductAuditStrategyGetAsync(this WechatApiClient client, Models.ChannelsECProductAuditStrategyGetRequest 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", "auditstrategy", "get")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.ChannelsECProductAuditStrategyGetResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /channels/ec/product/auditstrategy/set 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developers.weixin.qq.com/doc/store/shop/API/channels-shop-product/shop/api_setproductauditstrategy.html ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.ChannelsECProductAuditStrategySetResponse> ExecuteChannelsECProductAuditStrategySetAsync(this WechatApiClient client, Models.ChannelsECProductAuditStrategySetRequest 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", "auditstrategy", "set")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.ChannelsECProductAuditStrategySetResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ECProduct/Category
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /channels/ec/product/category/classify 接口。</para>
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /channels/ec/product/auditstrategy/get 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class ChannelsECProductAuditStrategyGetRequest : WechatApiRequest, IInferable<ChannelsECProductAuditStrategyGetRequest, ChannelsECProductAuditStrategyGetResponse>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /channels/ec/product/auditstrategy/get 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class ChannelsECProductAuditStrategyGetResponse : WechatApiResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class AuditStrategy
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置隐藏商品信息上架开关。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("hide_err_field_flag")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("hide_err_field_flag")]
|
||||
public int HideErrorFieldFlag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置可上架相似品开关。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("hit_duplicated_flag")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("hit_duplicated_flag")]
|
||||
public int HitDuplicatedFlag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置命中低风险规则可上架开关。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("hit_low_risk_rule_flag")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("hit_low_risk_rule_flag")]
|
||||
public int HitLowRiskRuleFlag { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置上架策略信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("audit_strategy")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("audit_strategy")]
|
||||
public Types.AuditStrategy AuditStrategy { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /channels/ec/product/auditstrategy/set 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class ChannelsECProductAuditStrategySetRequest : WechatApiRequest, IInferable<ChannelsECProductAuditStrategySetRequest, ChannelsECProductAuditStrategySetResponse>
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class AuditStrategy
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置隐藏商品信息上架开关。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("hide_err_field_flag")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("hide_err_field_flag")]
|
||||
public int? HideErrorFieldFlag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置可上架相似品开关。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("hit_duplicated_flag")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("hit_duplicated_flag")]
|
||||
public int? HitDuplicatedFlag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置命中低风险规则可上架开关。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("hit_low_risk_rule_flag")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("hit_low_risk_rule_flag")]
|
||||
public int? HitLowRiskRuleFlag { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置上架策略信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("audit_strategy")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("audit_strategy")]
|
||||
public Types.AuditStrategy AuditStrategy { get; set; } = new Types.AuditStrategy();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /channels/ec/product/auditstrategy/set 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class ChannelsECProductAuditStrategySetResponse : WechatApiResponse
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "",
|
||||
"audit_strategy": {
|
||||
"hide_err_field_flag": 1,
|
||||
"hit_duplicated_flag": 1,
|
||||
"hit_low_risk_rule_flag": 2
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"audit_strategy": {
|
||||
"hide_err_field_flag": 1,
|
||||
"hit_duplicated_flag": 2,
|
||||
"hit_low_risk_rule_flag": 0
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user