mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-07-15 23:13:32 +08:00
feat(work): 随官方更新获客助手相关接口模型
This commit is contained in:
parent
d79f2d9fa0
commit
d35a23578f
@ -615,6 +615,29 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinExternalContactCustomerAcquisitionQuotaResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /cgi-bin/externalcontact/customer_acquisition/statistic 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/97375 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinExternalContactCustomerAcquisitionStatisticResponse> ExecuteCgibinExternalContactCustomerAcquisitionStatisticAsync(this WechatWorkClient client, Models.CgibinExternalContactCustomerAcquisitionStatisticRequest 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.Get, "cgi-bin", "externalcontact", "customer_acquisition", "statistic")
|
||||
.SetQueryParam("access_token", request.AccessToken)
|
||||
.SetQueryParam("link_id", request.LinkId)
|
||||
.SetQueryParam("start_time", request.StartTimestamp)
|
||||
.SetQueryParam("end_time", request.EndTimestamp);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinExternalContactCustomerAcquisitionStatisticResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region CustomerStrategy
|
||||
|
@ -5,6 +5,26 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
/// </summary>
|
||||
public class CgibinExternalContactCustomerAcquisitionQuotaResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Quota
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置即将过期额度。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("balance")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("balance")]
|
||||
public int Balance { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置额度过期时间戳。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("expire_date")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("expire_date")]
|
||||
public long ExpireTimestamp { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置累计使用量。
|
||||
/// </summary>
|
||||
@ -18,5 +38,12 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
[Newtonsoft.Json.JsonProperty("balance")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("balance")]
|
||||
public int Balance { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置即将过期额度列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("quota_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("quota_list")]
|
||||
public Types.Quota[]? QuotaList { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,29 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /cgi-bin/externalcontact/customer_acquisition/statistic 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinExternalContactCustomerAcquisitionStatisticRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置获客链接 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string LinkId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置统计起始时间戳。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public long StartTimestamp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置统计结束时间戳。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public long EndTimestamp { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /cgi-bin/externalcontact/customer_acquisition/statistic 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinExternalContactCustomerAcquisitionStatisticResponse : WechatWorkResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置点击链接客户数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("click_link_customer_cnt")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("click_link_customer_cnt")]
|
||||
public int ClickLinkCustomerCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置新增客户数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("new_customer_cnt")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("new_customer_cnt")]
|
||||
public int NewCustomerCount { get; set; }
|
||||
}
|
||||
}
|
@ -2,5 +2,15 @@
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"total": 1000,
|
||||
"balance": 500
|
||||
"balance": 500,
|
||||
"quota_list": [
|
||||
{
|
||||
"expire_date": 1689350400,
|
||||
"balance": 200
|
||||
},
|
||||
{
|
||||
"expire_date": 1692028800,
|
||||
"balance": 300
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"click_link_customer_cnt": 1000,
|
||||
"new_customer_cnt": 500
|
||||
}
|
Loading…
Reference in New Issue
Block a user