mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-04-05 17:37:54 +08:00
feat(wxapi): 新增视频号助手留资组件相关接口
This commit is contained in:
parent
8685604944
commit
fa0c40a10f
@ -33,6 +33,10 @@
|
||||
|
||||
<summary>[展开查看]</summary>
|
||||
|
||||
- Release 2.23.0
|
||||
|
||||
- **新增**:新增第三方平台小程序流量主代运营相关接口。
|
||||
|
||||
- Release 2.22.0
|
||||
|
||||
- **新增**:新增第三方平台小程序流量主代运营相关接口。
|
||||
|
@ -2124,5 +2124,67 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
|
||||
return await client.SendRequestWithJsonAsync<Models.ChannelsECWindowProductListGetResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Leads
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /channels/leads/get_leads_info_by_component_id 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/channels/API/leads/get_leads_info_by_component_id.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.ChannelsLeadsGetLeadsInfoByComponentIdResponse> ExecuteChannelsLeadsGetLeadsInfoByComponentIdAsync(this WechatApiClient client, Models.ChannelsLeadsGetLeadsInfoByComponentIdRequest 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, "channels", "leads", "get_leads_info_by_component_id")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.ChannelsLeadsGetLeadsInfoByComponentIdResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /channels/leads/get_leads_info_by_request_id 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/channels/API/leads/get_leads_info_by_request_id.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.ChannelsLeadsGetLeadsInfoByRequestIdResponse> ExecuteChannelsLeadsGetLeadsInfoByRequestIdAsync(this WechatApiClient client, Models.ChannelsLeadsGetLeadsInfoByRequestIdRequest 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, "channels", "leads", "get_leads_info_by_request_id")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.ChannelsLeadsGetLeadsInfoByRequestIdResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /channels/leads/get_leads_request_id 接口。</para>
|
||||
/// <para>REF: https://developers.weixin.qq.com/doc/channels/API/leads/get_leads_request_id.html </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.ChannelsLeadsGetLeadsRequestIdResponse> ExecuteChannelsLeadsGetLeadsRequestIdAsync(this WechatApiClient client, Models.ChannelsLeadsGetLeadsRequestIdRequest 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, "channels", "leads", "get_leads_request_id")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.ChannelsLeadsGetLeadsRequestIdResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
@ -40,18 +40,18 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
[System.Text.Json.Serialization.JsonPropertyName("brands")]
|
||||
public Types.Brand[] BrandList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置翻页标记。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("next_key")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("next_key")]
|
||||
public string? NextCursor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否还有更多。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("continue_flag")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("continue_flag")]
|
||||
public bool HasMore { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置翻页标记。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("next_key")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("next_key")]
|
||||
public string? NextCursor { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,36 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /channels/leads/get_leads_info_by_component_id 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class ChannelsLeadsGetLeadsInfoByComponentIdRequest : WechatApiRequest, IInferable<ChannelsLeadsGetLeadsInfoByComponentIdRequest, ChannelsLeadsGetLeadsInfoByComponentIdResponse>
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置留资组件 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("leads_component_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("leads_component_id")]
|
||||
public string LeadsComponentId { get; set; } = string.Empty;
|
||||
|
||||
/// <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("last_buffer")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("last_buffer")]
|
||||
public string? Cursor { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /channels/leads/get_leads_info_by_component_id 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class ChannelsLeadsGetLeadsInfoByComponentIdResponse : WechatApiResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class UserData
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置电话号码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("phone")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("phone")]
|
||||
public string PhoneNumber { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户留资信息列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("user_data")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("user_data")]
|
||||
public Types.UserData[] UserDataList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否还有更多。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("continue_flag")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("continue_flag")]
|
||||
public bool HasMore { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置翻页标记。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("last_buffer")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("last_buffer")]
|
||||
public string? NextCursor { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /channels/leads/get_leads_info_by_request_id 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class ChannelsLeadsGetLeadsInfoByRequestIdRequest : WechatApiRequest, IInferable<ChannelsLeadsGetLeadsInfoByRequestIdRequest, ChannelsLeadsGetLeadsInfoByRequestIdResponse>
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置留资请求 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("request_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("request_id")]
|
||||
public string RequestId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置翻页标记。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("last_buffer")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("last_buffer")]
|
||||
public string? Cursor { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /channels/leads/get_leads_info_by_request_id 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class ChannelsLeadsGetLeadsInfoByRequestIdResponse : WechatApiResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class UserData : ChannelsLeadsGetLeadsInfoByComponentIdResponse.Types.UserData
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户留资信息列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("user_data")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("user_data")]
|
||||
public Types.UserData[] UserDataList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否还有更多。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("continue_flag")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("continue_flag")]
|
||||
public bool HasMore { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置翻页标记。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("last_buffer")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("last_buffer")]
|
||||
public string? NextCursor { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /channels/leads/get_leads_request_id 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class ChannelsLeadsGetLeadsRequestIdRequest : WechatApiRequest, IInferable<ChannelsLeadsGetLeadsRequestIdRequest, ChannelsLeadsGetLeadsRequestIdResponse>
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置留资组件 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("leads_component_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("leads_component_id")]
|
||||
public string LeadsComponentId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置翻页标记。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("last_buffer")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("last_buffer")]
|
||||
public string? Cursor { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /channels/leads/get_leads_request_id 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class ChannelsLeadsGetLeadsRequestIdResponse : WechatApiResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Request
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置留资请求 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("request_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("request_id")]
|
||||
public string RequestId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置直播开始时间戳。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("live_start_time")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("live_start_time")]
|
||||
public long LiveStartTimestamp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置直播描述。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("live_description")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("live_description")]
|
||||
public string LiveDescription { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置留资请求列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("item")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("item")]
|
||||
public Types.Request[] RequestList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否还有更多。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("continue_flag")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("continue_flag")]
|
||||
public bool HasMore { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置翻页标记。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("last_buffer")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("last_buffer")]
|
||||
public string? NextCursor { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"leads_component_id": "100234056999000000",
|
||||
"start_time": 0,
|
||||
"end_time": 1668676968,
|
||||
"last_buffer": "EB4YAg"
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"user_data": [
|
||||
{
|
||||
"phone": "18881222222"
|
||||
}
|
||||
],
|
||||
"last_buffer": "EB4YAg=",
|
||||
"continue_flag": true
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"request_id": "100234056",
|
||||
"last_buffer": "EB4YAg"
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"user_data": [
|
||||
{
|
||||
"phone": "18881222222"
|
||||
}
|
||||
],
|
||||
"last_buffer": "EB4YAg=",
|
||||
"continue_flag": true
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"leads_component_id": "100234056",
|
||||
"last_buffer": "EB4YAg"
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"item": [
|
||||
{
|
||||
"request_id": "18881222222",
|
||||
"live_start_time": 1668676968,
|
||||
"live_description": "xxx的直播"
|
||||
}
|
||||
],
|
||||
"last_buffer": "EB4YAg=",
|
||||
"continue_flag": true
|
||||
}
|
Loading…
Reference in New Issue
Block a user