mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-09-19 01:58:14 +08:00
feat(work): 新增获客助手获取成员多次收消息详情接口
This commit is contained in:
@@ -778,6 +778,29 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinExternalContactCustomerAcquisitionStatisticResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/externalcontact/customer_acquisition/get_chat_info 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/100130 ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinExternalContactCustomerAcquisitionGetChatInfoResponse> ExecuteCgibinExternalContactCustomerAcquisitionGetChatInfoAsync(this WechatWorkClient client, Models.CgibinExternalContactCustomerAcquisitionGetChatInfoRequest 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, "cgi-bin", "externalcontact", "customer_acquisition", "get_chat_info")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinExternalContactCustomerAcquisitionGetChatInfoResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region CustomerStrategy
|
||||
|
@@ -0,0 +1,15 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/externalcontact/customer_acquisition/get_chat_info 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinExternalContactCustomerAcquisitionGetChatInfoRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置会话信息凭据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("chat_key")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("chat_key")]
|
||||
public string ChatKey { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@@ -0,0 +1,56 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/externalcontact/customer_acquisition/get_chat_info 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinExternalContactCustomerAcquisitionGetChatInfoResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Chat
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置添加客户的获客链接 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("link_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("link_id")]
|
||||
public string LinkId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置添加客户的自定义参数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("state")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("state")]
|
||||
public string? State { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置收到的消息次数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("recv_msg_cnt")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("recv_msg_cnt")]
|
||||
public int ReceivedMessageCount { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置成员 UserId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("userid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("userid")]
|
||||
public string UserId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置外部成员 UserId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("external_userid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("external_userid")]
|
||||
public string ExternalUserId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置多次会话信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("chat_info")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("chat_info")]
|
||||
public Types.Chat Chat { get; set; } = default!;
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"chat_key": "CHAT_KEY"
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"userid": "zhangsan",
|
||||
"external_userid": "woAJ2GCAAAXtWyujaWJHDDGi0mACAAA",
|
||||
"chat_info": {
|
||||
"recv_msg_cnt": 3,
|
||||
"link_id": "caXXXXXXX",
|
||||
"state": "STATE"
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user